mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
[release/v7.4.0-preview.6] Revert changes to continue using BinaryFormatter for Out-GridView (#20300) (#20360)
This commit is contained in:
+1
-13
@@ -13,6 +13,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public abstract class ComparableValueFilterRule<T> : FilterRule where T : IComparable
|
||||
{
|
||||
#region Properties
|
||||
@@ -61,19 +62,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
return this.Evaluate(castItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the ComparableValueFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the ComparableValueFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
ComparableValueFilterRule<T> rule = (ComparableValueFilterRule<T>)Activator.CreateInstance(this.GetType());
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if item matches a derived classes criteria.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -13,6 +13,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class DoesNotEqualFilterRule<T> : EqualsFilterRule<T> where T : IComparable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,20 +25,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DefaultNullValueEvaluation = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the DoesNotEqualFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A clone of the DoesNotEqualFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
DoesNotEqualFilterRule<T> rule = new DoesNotEqualFilterRule<T>();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if item is not equal to Value.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class EqualsFilterRule<T> : SingleValueComparableValueFilterRule<T> where T : IComparable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,20 +25,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_Equals;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new EqualsFilterRule that is a clone of the current instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A new EqualsFilterRule that is a clone of the current instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
EqualsFilterRule<T> rule = new EqualsFilterRule<T>();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if item is equal to Value.
|
||||
/// </summary>
|
||||
|
||||
+1
-6
@@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The base class for all filtering rules.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public abstract class FilterRule : IEvaluate
|
||||
{
|
||||
/// <summary>
|
||||
@@ -48,12 +49,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// <returns>Returns true if the item meets the criteria. False otherwise.</returns>
|
||||
public abstract bool Evaluate(object item);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of this FilterRule.
|
||||
/// </summary>
|
||||
/// <returns>Returns a clone of this FilterRule.</returns>
|
||||
public abstract FilterRule Clone();
|
||||
|
||||
#region EvaluationResultInvalidated
|
||||
|
||||
/// <summary>
|
||||
|
||||
+24
-1
@@ -27,7 +27,30 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// </returns>
|
||||
public static FilterRule DeepCopy(this FilterRule rule)
|
||||
{
|
||||
return rule.Clone();
|
||||
ArgumentNullException.ThrowIfNull(rule);
|
||||
|
||||
#pragma warning disable SYSLIB0050
|
||||
Debug.Assert(rule.GetType().IsSerializable, "rule is serializable");
|
||||
#pragma warning disable SYSLIB0011
|
||||
BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.Clone));
|
||||
#pragma warning restore SYSLIB0011
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
FilterRule copy = null;
|
||||
try
|
||||
{
|
||||
formatter.Serialize(ms, rule);
|
||||
|
||||
ms.Position = 0;
|
||||
copy = (FilterRule)formatter.Deserialize(ms);
|
||||
#pragma warning restore SYSLIB0050
|
||||
}
|
||||
finally
|
||||
{
|
||||
ms.Close();
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-15
@@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class IsBetweenFilterRule<T> : ComparableValueFilterRule<T> where T : IComparable
|
||||
{
|
||||
#region Properties
|
||||
@@ -50,21 +51,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
protected set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the FilterRule.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A clone of the FilterRule.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
IsBetweenFilterRule<T> clone = new IsBetweenFilterRule<T>();
|
||||
clone.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
clone.StartValue = this.StartValue;
|
||||
clone.EndValue = this.EndValue;
|
||||
return clone;
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Ctor
|
||||
|
||||
+1
-12
@@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// is empty or not.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class IsEmptyFilterRule : FilterRule
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,18 +21,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_IsEmpty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the IsEmptyFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A clone of IsEmptyFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
IsEmptyFilterRule rule = new IsEmptyFilterRule();
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a values indicating whether the supplied item is empty.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class IsGreaterThanFilterRule<T> : SingleValueComparableValueFilterRule<T> where T : IComparable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,20 +25,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_GreaterThanOrEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new IsGreaterThanFilterRule that is a clone of the current instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A new IsGreaterThanFilterRule that is a clone of the current instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
IsGreaterThanFilterRule<T> rule = new IsGreaterThanFilterRule<T>();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if item is greater than Value.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class IsLessThanFilterRule<T> : SingleValueComparableValueFilterRule<T> where T : IComparable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,20 +25,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_LessThanOrEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new IsLessThanFilterRule that is a clone of the current instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A new IsLessThanFilterRule that is a clone of the current instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
IsLessThanFilterRule<T> rule = new IsLessThanFilterRule<T>();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if item is less than Value.
|
||||
/// </summary>
|
||||
|
||||
+1
-12
@@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// is empty or not.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class IsNotEmptyFilterRule : IsEmptyFilterRule
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,18 +21,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_IsNotEmpty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the IsNotEmptyFilterRule.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A clone of the IsNotEmptyFilterRule.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
IsNotEmptyFilterRule rule = new IsNotEmptyFilterRule();
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a values indicating whether the supplied item is not empty.
|
||||
/// </summary>
|
||||
|
||||
+1
@@ -9,6 +9,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The IsNotEmptyValidationRule checks a value to see if a value is not empty.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class IsNotEmptyValidationRule : DataErrorInfoValidationRule
|
||||
{
|
||||
#region Properties
|
||||
|
||||
+1
-14
@@ -12,6 +12,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// Represents a filter rule that searches for text within properties on an object.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class PropertiesTextContainsFilterRule : TextFilterRule
|
||||
{
|
||||
private static readonly string TextContainsCharactersRegexPattern = "{0}";
|
||||
@@ -37,20 +38,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of this <see cref="PropertiesTextContainsFilterRule"/>.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A clone of this <see cref="PropertiesTextContainsFilterRule"/>.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
PropertiesTextContainsFilterRule clone = new PropertiesTextContainsFilterRule();
|
||||
clone.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
clone.PropertyNames = new List<string>(this.PropertyNames);
|
||||
return clone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Evaluates whether the specified properties on <paramref name="item"/> contain the current value.
|
||||
/// </summary>
|
||||
|
||||
+1
-16
@@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class PropertyValueSelectorFilterRule<T> : SelectorFilterRule where T : IComparable
|
||||
{
|
||||
#region Properties
|
||||
@@ -65,11 +66,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// </param>
|
||||
public PropertyValueSelectorFilterRule(string propertyName, string propertyDisplayName, IEnumerable<FilterRule> rules)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrEmpty(propertyName);
|
||||
ArgumentException.ThrowIfNullOrEmpty(propertyDisplayName);
|
||||
|
||||
ArgumentNullException.ThrowIfNull(rules);
|
||||
|
||||
this.PropertyName = propertyName;
|
||||
this.DisplayName = propertyDisplayName;
|
||||
|
||||
@@ -120,17 +116,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
return this.AvailableRules.SelectedValue.Evaluate(propertyValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the PropertyValueSelectorFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the PropertyValueSelectorFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
return new PropertyValueSelectorFilterRule<T>(this.PropertyName, this.DisplayName, this.AvailableRules.AvailableValues);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
+1
-17
@@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The SelectorFilterRule represents a rule composed of other rules.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class SelectorFilterRule : FilterRule
|
||||
{
|
||||
#region Properties
|
||||
@@ -70,23 +71,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
return this.AvailableRules.SelectedValue.Evaluate(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the SelectorFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the SelectorFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
SelectorFilterRule clone = new SelectorFilterRule();
|
||||
clone.DisplayName = this.DisplayName;
|
||||
clone.AvailableRules = this.AvailableRules;
|
||||
clone.AvailableRules.SelectedValueChanged += clone.AvailableRules_SelectedValueChanged;
|
||||
clone.AvailableRules.SelectedValue.EvaluationResultInvalidated += clone.SelectedValue_EvaluationResultInvalidated;
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the SelectedValue within AvailableRules changes.
|
||||
/// </summary>
|
||||
|
||||
+1
-9
@@ -13,6 +13,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The generic parameter.</typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public abstract class SingleValueComparableValueFilterRule<T> : ComparableValueFilterRule<T> where T : IComparable
|
||||
{
|
||||
#region Properties
|
||||
@@ -53,15 +54,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
|
||||
#endregion Ctor
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the FilterRule.
|
||||
/// </summary>
|
||||
/// <returns>A clone of the FilterRule.</returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
return base.Clone();
|
||||
}
|
||||
|
||||
private void Value_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Value")
|
||||
|
||||
+1
-14
@@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// check if it is contains the rule's value within it.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class TextContainsFilterRule : TextFilterRule
|
||||
{
|
||||
private static readonly string TextContainsCharactersRegexPattern = "{0}";
|
||||
@@ -24,20 +25,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_Contains;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the TextContainsFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the TextContainsFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
TextContainsFilterRule rule = new TextContainsFilterRule();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if Value is contained within data.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// check if it is does not contain the rule's value within it.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class TextDoesNotContainFilterRule : TextContainsFilterRule
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,20 +22,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DefaultNullValueEvaluation = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the TextDoesNotContainFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A clone of the TextDoesNotContainFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
TextDoesNotContainFilterRule rule = new TextDoesNotContainFilterRule();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if Value is not contained within data.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -10,6 +10,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// check if it is not equal to the rule's value.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class TextDoesNotEqualFilterRule : TextEqualsFilterRule
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,20 +22,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DefaultNullValueEvaluation = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the TextDoesNotEqualFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the TextDoesNotEqualFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
TextDoesNotEqualFilterRule rule = new TextDoesNotEqualFilterRule();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if data is not equal to Value.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// check if it ends with the rule's value.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class TextEndsWithFilterRule : TextFilterRule
|
||||
{
|
||||
private static readonly string TextEndsWithCharactersRegexPattern = "{0}$";
|
||||
@@ -24,20 +25,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_TextEndsWith;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the TextEndsWithFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the TextEndsWithFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
TextEndsWithFilterRule rule = new TextEndsWithFilterRule();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if data ends with Value.
|
||||
/// </summary>
|
||||
|
||||
+1
-14
@@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// check if it is equal to the rule's value.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class TextEqualsFilterRule : TextFilterRule
|
||||
{
|
||||
private static readonly string TextEqualsCharactersRegexPattern = "^{0}$";
|
||||
@@ -23,20 +24,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_Equals;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the TextEqualsFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the TextEqualsFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
TextEqualsFilterRule rule = new TextEqualsFilterRule();
|
||||
rule.Value = this.Value;
|
||||
rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
|
||||
return rule;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if data is equal to Value.
|
||||
/// </summary>
|
||||
|
||||
+1
-11
@@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// evaluating string operations.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public abstract class TextFilterRule : SingleValueComparableValueFilterRule<string>
|
||||
{
|
||||
/// <summary>
|
||||
@@ -60,17 +61,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the FilterRule.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the FilterRule.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
return base.Clone();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the TextFilterRule class.
|
||||
/// </summary>
|
||||
|
||||
+1
-11
@@ -11,6 +11,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// check if it starts with the rule's value.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class TextStartsWithFilterRule : TextFilterRule
|
||||
{
|
||||
private static readonly string TextStartsWithCharactersRegexPattern = "^{0}";
|
||||
@@ -24,17 +25,6 @@ namespace Microsoft.Management.UI.Internal
|
||||
this.DisplayName = UICultureResources.FilterRule_TextStartsWith;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a clone of the TextStartsWithFilterRule instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns a clone of the TextStartsWithFilterRule instance.
|
||||
/// </returns>
|
||||
public override FilterRule Clone()
|
||||
{
|
||||
return base.Clone();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if data starts with Value.
|
||||
/// </summary>
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class ValidatingSelectorValue<T> : ValidatingValueBase
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// The generic parameter.
|
||||
/// </typeparam>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class ValidatingValue<T> : ValidatingValueBase
|
||||
{
|
||||
#region Properties
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// classes to support validation via the IDataErrorInfo interface.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public abstract class ValidatingValueBase : IDataErrorInfo, INotifyPropertyChanged
|
||||
{
|
||||
#region Properties
|
||||
|
||||
+1
@@ -9,6 +9,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// Provides a way to create a custom rule in order to check the validity of user input.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public abstract class DataErrorInfoValidationRule
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+1
@@ -12,6 +12,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// a FilterRule value to its DisplayName.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class FilterRuleToDisplayNameConverter : IValueConverter
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
/// Allows the state of the ManagementList to be saved and restored.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
|
||||
[Serializable]
|
||||
public class ManagementListStateDescriptor : StateDescriptor<ManagementList>
|
||||
{
|
||||
#region Fields
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<ApplicationManifest>..\..\assets\pwsh.manifest</ApplicationManifest>
|
||||
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>8.0</TargetPlatformVersion>
|
||||
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
Reference in New Issue
Block a user