diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs
index 1c689643f5..9e6329e20a 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs
@@ -61,6 +61,19 @@ namespace Microsoft.Management.UI.Internal
return this.Evaluate(castItem);
}
+ ///
+ /// Creates a clone of the ComparableValueFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the ComparableValueFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ ComparableValueFilterRule rule = (ComparableValueFilterRule)Activator.CreateInstance(this.GetType());
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if item matches a derived classes criteria.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs
index 636e76e5c8..d616d9f5ba 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs
@@ -24,6 +24,20 @@ namespace Microsoft.Management.UI.Internal
this.DefaultNullValueEvaluation = true;
}
+ ///
+ /// Creates a clone of the DoesNotEqualFilterRule instance.
+ ///
+ ///
+ /// A clone of the DoesNotEqualFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ DoesNotEqualFilterRule rule = new DoesNotEqualFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if item is not equal to Value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs
index 1661b11d9f..a8a1762730 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs
@@ -24,6 +24,20 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_Equals;
}
+ ///
+ /// Creates a new EqualsFilterRule that is a clone of the current instance.
+ ///
+ ///
+ /// A new EqualsFilterRule that is a clone of the current instance.
+ ///
+ public override FilterRule Clone()
+ {
+ EqualsFilterRule rule = new EqualsFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if item is equal to Value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs
index 3309f33f4a..b7eec63946 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs
@@ -48,6 +48,12 @@ namespace Microsoft.Management.UI.Internal
/// Returns true if the item meets the criteria. False otherwise.
public abstract bool Evaluate(object item);
+ ///
+ /// Creates a clone of this FilterRule.
+ ///
+ /// Returns a clone of this FilterRule.
+ public abstract FilterRule Clone();
+
#region EvaluationResultInvalidated
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs
index 76f10f0e22..845d35dd95 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs
@@ -27,7 +27,7 @@ namespace Microsoft.Management.UI.Internal
///
public static FilterRule DeepCopy(this FilterRule rule)
{
- throw new NotSupportedException();
+ return rule.Clone();
}
}
}
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs
index 3acced159c..597bafb6db 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs
@@ -50,6 +50,21 @@ namespace Microsoft.Management.UI.Internal
protected set;
}
+ ///
+ /// Creates a clone of the FilterRule.
+ ///
+ ///
+ /// A clone of the FilterRule.
+ ///
+ public override FilterRule Clone()
+ {
+ IsBetweenFilterRule clone = new IsBetweenFilterRule();
+ clone.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ clone.StartValue = this.StartValue;
+ clone.EndValue = this.EndValue;
+ return clone;
+ }
+
#endregion Properties
#region Ctor
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs
index 21b78e4e16..d523409e53 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs
@@ -20,6 +20,18 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_IsEmpty;
}
+ ///
+ /// Creates a clone of the IsEmptyFilterRule instance.
+ ///
+ ///
+ /// A clone of IsEmptyFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ IsEmptyFilterRule rule = new IsEmptyFilterRule();
+ return rule;
+ }
+
///
/// Gets a values indicating whether the supplied item is empty.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs
index 94b3170c5a..e2cea2d488 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs
@@ -24,6 +24,20 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_GreaterThanOrEqual;
}
+ ///
+ /// Creates a new IsGreaterThanFilterRule that is a clone of the current instance.
+ ///
+ ///
+ /// A new IsGreaterThanFilterRule that is a clone of the current instance.
+ ///
+ public override FilterRule Clone()
+ {
+ IsGreaterThanFilterRule rule = new IsGreaterThanFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if item is greater than Value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs
index 7fc732ebbd..905d14648c 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs
@@ -24,6 +24,20 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_LessThanOrEqual;
}
+ ///
+ /// Creates a new IsLessThanFilterRule that is a clone of the current instance.
+ ///
+ ///
+ /// A new IsLessThanFilterRule that is a clone of the current instance.
+ ///
+ public override FilterRule Clone()
+ {
+ IsLessThanFilterRule rule = new IsLessThanFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if item is less than Value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs
index 1811e18bcd..b6410917e9 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs
@@ -20,6 +20,18 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_IsNotEmpty;
}
+ ///
+ /// Creates a clone of the IsNotEmptyFilterRule.
+ ///
+ ///
+ /// A clone of the IsNotEmptyFilterRule.
+ ///
+ public override FilterRule Clone()
+ {
+ IsNotEmptyFilterRule rule = new IsNotEmptyFilterRule();
+ return rule;
+ }
+
///
/// Gets a values indicating whether the supplied item is not empty.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs
index d9992cd626..e1be855825 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs
@@ -37,6 +37,20 @@ namespace Microsoft.Management.UI.Internal
private set;
}
+ ///
+ /// Creates a clone of this .
+ ///
+ ///
+ /// A clone of this .
+ ///
+ public override FilterRule Clone()
+ {
+ PropertiesTextContainsFilterRule clone = new PropertiesTextContainsFilterRule();
+ clone.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ clone.PropertyNames = new List(this.PropertyNames);
+ return clone;
+ }
+
///
/// Evaluates whether the specified properties on contain the current value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs
index 74b8d2a869..551ae38d45 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs
@@ -120,6 +120,17 @@ namespace Microsoft.Management.UI.Internal
return this.AvailableRules.SelectedValue.Evaluate(propertyValue);
}
+ ///
+ /// Creates a clone of the PropertyValueSelectorFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the PropertyValueSelectorFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ return new PropertyValueSelectorFilterRule(this.PropertyName, this.DisplayName, this.AvailableRules.AvailableValues);
+ }
+
#endregion Public Methods
#region Private Methods
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs
index e2430dde6d..6f0042cb48 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs
@@ -70,6 +70,23 @@ namespace Microsoft.Management.UI.Internal
return this.AvailableRules.SelectedValue.Evaluate(item);
}
+ ///
+ /// Creates a clone of the SelectorFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the SelectorFilterRule instance.
+ ///
+ 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;
+ }
+
///
/// Called when the SelectedValue within AvailableRules changes.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs
index 526f53f861..e716369cb2 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs
@@ -53,6 +53,15 @@ namespace Microsoft.Management.UI.Internal
#endregion Ctor
+ ///
+ /// Creates a clone of the FilterRule.
+ ///
+ /// A clone of the FilterRule.
+ public override FilterRule Clone()
+ {
+ return base.Clone();
+ }
+
private void Value_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "Value")
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs
index b41cc90185..db3a6e57e2 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs
@@ -24,6 +24,20 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_Contains;
}
+ ///
+ /// Creates a clone of the TextContainsFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the TextContainsFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ TextContainsFilterRule rule = new TextContainsFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if Value is contained within data.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs
index dc077f6a2b..e211d4ca8b 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs
@@ -21,6 +21,20 @@ namespace Microsoft.Management.UI.Internal
this.DefaultNullValueEvaluation = true;
}
+ ///
+ /// Creates a clone of the TextDoesNotContainFilterRule instance.
+ ///
+ ///
+ /// A clone of the TextDoesNotContainFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ TextDoesNotContainFilterRule rule = new TextDoesNotContainFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if Value is not contained within data.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs
index c211c6d9d1..f3a8d5353a 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs
@@ -21,6 +21,20 @@ namespace Microsoft.Management.UI.Internal
this.DefaultNullValueEvaluation = true;
}
+ ///
+ /// Creates a clone of the TextDoesNotEqualFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the TextDoesNotEqualFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ TextDoesNotEqualFilterRule rule = new TextDoesNotEqualFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if data is not equal to Value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs
index e369a1dbcc..b1ef79bc6b 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs
@@ -24,6 +24,20 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_TextEndsWith;
}
+ ///
+ /// Creates a clone of the TextEndsWithFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the TextEndsWithFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ TextEndsWithFilterRule rule = new TextEndsWithFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if data ends with Value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs
index fdf8cc0916..5c296dc203 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs
@@ -23,6 +23,20 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_Equals;
}
+ ///
+ /// Creates a clone of the TextEqualsFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the TextEqualsFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ TextEqualsFilterRule rule = new TextEqualsFilterRule();
+ rule.Value = this.Value;
+ rule.DefaultNullValueEvaluation = this.DefaultNullValueEvaluation;
+ return rule;
+ }
+
///
/// Determines if data is equal to Value.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs
index ef08d644dc..b2ab66a0db 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs
@@ -60,6 +60,17 @@ namespace Microsoft.Management.UI.Internal
}
}
+ ///
+ /// Creates a clone of the FilterRule.
+ ///
+ ///
+ /// Returns a clone of the FilterRule.
+ ///
+ public override FilterRule Clone()
+ {
+ return base.Clone();
+ }
+
///
/// Initializes a new instance of the TextFilterRule class.
///
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs
index db9bb5d561..d04079ee01 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs
@@ -24,6 +24,17 @@ namespace Microsoft.Management.UI.Internal
this.DisplayName = UICultureResources.FilterRule_TextStartsWith;
}
+ ///
+ /// Creates a clone of the TextStartsWithFilterRule instance.
+ ///
+ ///
+ /// Returns a clone of the TextStartsWithFilterRule instance.
+ ///
+ public override FilterRule Clone()
+ {
+ return base.Clone();
+ }
+
///
/// Determines if data starts with Value.
///