/// <summary> /// Creates a new text condition with the specified text comparison type based on the specified cell. /// </summary> /// <param name="compareType">The type of comparison.</param> /// <param name="expected">The expected text.</param> /// <param name="formula">The expected formula.</param> internal TextCondition(TextCompareType compareType, object expected, string formula) : base(expected, formula) { this.regex = null; this.compareType = compareType; this.useWildCards = true; this.ignoreCase = false; }
/// <summary> /// Called when reading XML. /// </summary> /// <param name="reader">The reader.</param> protected override void OnReadXml(XmlReader reader) { base.OnReadXml(reader); string name = reader.Name; if (name != null) { if (name != "Type") { if (name != "UseWildCards") { if (name == "IgnoreCase") { this.ignoreCase = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; } if (name == "ForceText") { this.forceValue2Text = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); } return; } } else { this.compareType = (TextCompareType)Serializer.DeserializeObj(typeof(TextCompareType), reader); return; } this.useWildCards = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); } }
/// <summary> /// Resets this instance. /// </summary> protected override void Reset() { base.Reset(); this.compareType = TextCompareType.EqualsTo; this.useWildCards = true; this.ignoreCase = false; this.forceValue2Text = false; }
/// <summary>Установка способа сравнения строк для модели представления коллекции</summary> /// <param name="element">Модель представления коллекции, для которой устанавливается способ сравнения строк</param> /// <param name="value">Устанавливаемый способ сравнения строк</param> public static void SetTextCompareType([Annotations.NotNull] DependencyObject element, TextCompareType value) => element.SetValue(TextCompareTypeProperty, value);
/// <summary> /// Creates a TextCondition object from a string. /// </summary> /// <param name="compareType">The compare type.</param> /// <param name="expected">The expected string.</param> /// <returns>The TextCondition object.</returns> public static TextCondition FromString(TextCompareType compareType, string expected) { return(new TextCondition(compareType, expected, null)); }
/// <summary> /// Creates a TextCondition object from a formula. /// </summary> /// <param name="compareType">The compare type.</param> /// <param name="formula">The formula.</param> /// <returns>The TextCondition object.</returns> public static TextCondition FromFormula(TextCompareType compareType, string formula) { return(new TextCondition(compareType, null, formula)); }