Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbafa5a

Browse files
authored
FixOut-GridView by replacing use of obsoleteBinaryFormatter with custom implementation (#25497)
1 parenteb1cc6d commitcbafa5a

File tree

27 files changed

+346
-48
lines changed

27 files changed

+346
-48
lines changed

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ namespace Microsoft.Management.UI.Internal
1616
[Serializable]
1717
publicabstractclassComparableValueFilterRule<T>:FilterRulewhereT:IComparable
1818
{
19+
/// <summary>
20+
/// Initializes a new instance of the <see cref="ComparableValueFilterRule{T}"/> class.
21+
/// </summary>
22+
protectedComparableValueFilterRule()
23+
{
24+
}
25+
26+
/// <summary>
27+
/// Initializes a new instance of the <see cref="ComparableValueFilterRule{T}"/> class.
28+
/// </summary>
29+
/// <param name="source">The source to initialize from.</param>
30+
protectedComparableValueFilterRule(ComparableValueFilterRule<T>source)
31+
:base(source)
32+
{
33+
this.DefaultNullValueEvaluation=source.DefaultNullValueEvaluation;
34+
}
35+
1936
#region Properties
2037

2138
/// <summary>

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,23 @@ namespace Microsoft.Management.UI.Internal
1717
publicclassDoesNotEqualFilterRule<T>:EqualsFilterRule<T>whereT:IComparable
1818
{
1919
/// <summary>
20-
/// Initializes a new instance of the DoesNotEqualFilterRule class.
20+
/// Initializes a new instance of the<see cref="DoesNotEqualFilterRule{T}"/> class.
2121
/// </summary>
2222
publicDoesNotEqualFilterRule()
2323
{
2424
this.DisplayName=UICultureResources.FilterRule_DoesNotEqual;
2525
this.DefaultNullValueEvaluation=true;
2626
}
2727

28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="DoesNotEqualFilterRule{T}"/> class.
30+
/// </summary>
31+
/// <param name="source">The source to initialize from.</param>
32+
publicDoesNotEqualFilterRule(DoesNotEqualFilterRule<T>source)
33+
:base(source)
34+
{
35+
}
36+
2837
/// <summary>
2938
/// Determines if item is not equal to Value.
3039
/// </summary>

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@ namespace Microsoft.Management.UI.Internal
1818
publicclassEqualsFilterRule<T>:SingleValueComparableValueFilterRule<T>whereT:IComparable
1919
{
2020
/// <summary>
21-
/// Initializes a new instance of the EqualsFilterRule class.
21+
/// Initializes a new instance of the<see cref="EqualsFilterRule{T}"/> class.
2222
/// </summary>
2323
publicEqualsFilterRule()
2424
{
2525
this.DisplayName=UICultureResources.FilterRule_Equals;
2626
}
2727

28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="EqualsFilterRule{T}"/> class.
30+
/// </summary>
31+
/// <param name="source">The source to initialize from.</param>
32+
publicEqualsFilterRule(EqualsFilterRule<T>source)
33+
:base(source)
34+
{
35+
}
36+
2837
/// <summary>
2938
/// Determines if item is equal to Value.
3039
/// </summary>

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.Management.UI.Internal
1010
/// </summary>
1111
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal","CA903:InternalNamespaceShouldNotContainPublicTypes")]
1212
[Serializable]
13-
publicabstractclassFilterRule:IEvaluate
13+
publicabstractclassFilterRule:IEvaluate,IDeepCloneable
1414
{
1515
/// <summary>
1616
/// Gets a value indicating whether the FilterRule can be
@@ -34,12 +34,28 @@ public string DisplayName
3434
}
3535

3636
/// <summary>
37-
/// Initializes a new instance of the FilterRule class.
37+
/// Initializes a new instance of the<see cref="FilterRule"/> class.
3838
/// </summary>
3939
protectedFilterRule()
4040
{
4141
}
4242

43+
/// <summary>
44+
/// Initializes a new instance of the <see cref="FilterRule"/> class.
45+
/// </summary>
46+
/// <param name="source">The source to initialize from.</param>
47+
protectedFilterRule(FilterRulesource)
48+
{
49+
ArgumentNullException.ThrowIfNull(source);
50+
this.DisplayName=source.DisplayName;
51+
}
52+
53+
/// <inheritdoc cref="IDeepCloneable.DeepClone()" />
54+
publicobjectDeepClone()
55+
{
56+
returnActivator.CreateInstance(this.GetType(),newobject[]{this});
57+
}
58+
4359
/// <summary>
4460
/// Gets a value indicating whether the supplied item meets the
4561
/// criteria specified by this rule.

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Licensed under the MIT License.
33

44
usingSystem;
5-
usingSystem.Diagnostics;
6-
usingSystem.IO;
7-
usingSystem.Runtime.Serialization;
8-
usingSystem.Runtime.Serialization.Formatters.Binary;
95

106
namespaceMicrosoft.Management.UI.Internal
117
{
@@ -28,29 +24,7 @@ public static class FilterRuleExtensions
2824
publicstaticFilterRuleDeepCopy(thisFilterRulerule)
2925
{
3026
ArgumentNullException.ThrowIfNull(rule);
31-
32-
#pragma warning disableSYSLIB0050
33-
Debug.Assert(rule.GetType().IsSerializable,"rule is serializable");
34-
#pragma warning disableSYSLIB0011
35-
BinaryFormatterformatter=newBinaryFormatter(null,newStreamingContext(StreamingContextStates.Clone));
36-
#pragma warning restoreSYSLIB0011
37-
MemoryStreamms=newMemoryStream();
38-
39-
FilterRulecopy=null;
40-
try
41-
{
42-
formatter.Serialize(ms,rule);
43-
44-
ms.Position=0;
45-
copy=(FilterRule)formatter.Deserialize(ms);
46-
#pragma warning restoreSYSLIB0050
47-
}
48-
finally
49-
{
50-
ms.Close();
51-
}
52-
53-
returncopy;
27+
return(FilterRule)rule.DeepClone();
5428
}
5529
}
5630
}

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public ValidatingValue<T> EndValue
5656
#region Ctor
5757

5858
/// <summary>
59-
/// Initializes a new instance of the IsBetweenFilterRule class.
59+
/// Initializes a new instance of the<see cref="IsBetweenFilterRule{T}"/> class.
6060
/// </summary>
6161
publicIsBetweenFilterRule()
6262
{
@@ -69,6 +69,20 @@ public IsBetweenFilterRule()
6969
this.EndValue.PropertyChanged+=this.Value_PropertyChanged;
7070
}
7171

72+
/// <summary>
73+
/// Initializes a new instance of the <see cref="IsBetweenFilterRule{T}"/> class.
74+
/// </summary>
75+
/// <param name="source">The source to initialize from.</param>
76+
publicIsBetweenFilterRule(IsBetweenFilterRule<T>source)
77+
:base(source)
78+
{
79+
this.StartValue=(ValidatingValue<T>)source.StartValue.DeepClone();
80+
this.StartValue.PropertyChanged+=this.Value_PropertyChanged;
81+
82+
this.EndValue=(ValidatingValue<T>)source.EndValue.DeepClone();
83+
this.EndValue.PropertyChanged+=this.Value_PropertyChanged;
84+
}
85+
7286
#endregion Ctor
7387

7488
#region Public Methods

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,22 @@ namespace Microsoft.Management.UI.Internal
1414
publicclassIsEmptyFilterRule:FilterRule
1515
{
1616
/// <summary>
17-
/// Initializes a new instance of the IsEmptyFilterRule class.
17+
/// Initializes a new instance of the<see cref="IsEmptyFilterRule"/> class.
1818
/// </summary>
1919
publicIsEmptyFilterRule()
2020
{
2121
this.DisplayName=UICultureResources.FilterRule_IsEmpty;
2222
}
2323

24+
/// <summary>
25+
/// Initializes a new instance of the <see cref="IsEmptyFilterRule"/> class.
26+
/// </summary>
27+
/// <param name="source">The source to initialize from.</param>
28+
publicIsEmptyFilterRule(IsEmptyFilterRulesource)
29+
:base(source)
30+
{
31+
}
32+
2433
/// <summary>
2534
/// Gets a values indicating whether the supplied item is empty.
2635
/// </summary>

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@ namespace Microsoft.Management.UI.Internal
1818
publicclassIsGreaterThanFilterRule<T>:SingleValueComparableValueFilterRule<T>whereT:IComparable
1919
{
2020
/// <summary>
21-
/// Initializes a new instance of the IsGreaterThanFilterRule class.
21+
/// Initializes a new instance of the<see cref="IsGreaterThanFilterRule{T}"/> class.
2222
/// </summary>
2323
publicIsGreaterThanFilterRule()
2424
{
2525
this.DisplayName=UICultureResources.FilterRule_GreaterThanOrEqual;
2626
}
2727

28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="IsGreaterThanFilterRule{T}"/> class.
30+
/// </summary>
31+
/// <param name="source">The source to initialize from.</param>
32+
publicIsGreaterThanFilterRule(IsGreaterThanFilterRule<T>source)
33+
:base(source)
34+
{
35+
}
36+
2837
/// <summary>
2938
/// Determines if item is greater than Value.
3039
/// </summary>

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@ namespace Microsoft.Management.UI.Internal
1818
publicclassIsLessThanFilterRule<T>:SingleValueComparableValueFilterRule<T>whereT:IComparable
1919
{
2020
/// <summary>
21-
/// Initializes a new instance of the IsLessThanFilterRule class.
21+
/// Initializes a new instance of the<see cref="IsLessThanFilterRule{T}"/> class.
2222
/// </summary>
2323
publicIsLessThanFilterRule()
2424
{
2525
this.DisplayName=UICultureResources.FilterRule_LessThanOrEqual;
2626
}
2727

28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="IsLessThanFilterRule{T}"/> class.
30+
/// </summary>
31+
/// <param name="source">The source to initialize from.</param>
32+
publicIsLessThanFilterRule(IsLessThanFilterRule<T>source)
33+
:base(source)
34+
{
35+
}
36+
2837
/// <summary>
2938
/// Determines if item is less than Value.
3039
/// </summary>

‎src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,22 @@ namespace Microsoft.Management.UI.Internal
1414
publicclassIsNotEmptyFilterRule:IsEmptyFilterRule
1515
{
1616
/// <summary>
17-
/// Initializes a new instance of the IsNotEmptyFilterRule class.
17+
/// Initializes a new instance of the<see cref="IsNotEmptyFilterRule"/> class.
1818
/// </summary>
1919
publicIsNotEmptyFilterRule()
2020
{
2121
this.DisplayName=UICultureResources.FilterRule_IsNotEmpty;
2222
}
2323

24+
/// <summary>
25+
/// Initializes a new instance of the <see cref="IsNotEmptyFilterRule"/> class.
26+
/// </summary>
27+
/// <param name="source">The source to initialize from.</param>
28+
publicIsNotEmptyFilterRule(IsNotEmptyFilterRulesource)
29+
:base(source)
30+
{
31+
}
32+
2433
/// <summary>
2534
/// Gets a values indicating whether the supplied item is not empty.
2635
/// </summary>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp