/// <summary> /// Resets this instance. /// </summary> protected override void Reset() { base.Reset(); this.compareType = RelationCompareType.And; this.item1 = null; this.item2 = null; }
/// <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 != "Item1") { if (name == "Item2") { this.item2 = Serializer.DeserializeObj(null, reader) as ConditionBase; } return; } } else { this.compareType = (RelationCompareType)Serializer.DeserializeObj(typeof(RelationCompareType), reader); return; } this.item1 = Serializer.DeserializeObj(null, reader) as ConditionBase; } }
/// <summary> /// Creates a RelationCondition object. /// </summary> /// <param name="compareType">Type of the comparison.</param> /// <param name="item1">The first condition.</param> /// <param name="item2">The second condition.</param> /// <returns>The RelationCondition object.</returns> public static RelationCondition Create(RelationCompareType compareType, ConditionBase item1, ConditionBase item2) { return(new RelationCondition(compareType, item1, item2)); }
/// <summary> /// Creates a new relation condition with a specified relation type. /// </summary> /// <param name="compareType">The relation between the first and second condition.</param> /// <param name="item1">The first condition.</param> /// <param name="item2">The second condition.</param> internal RelationCondition(RelationCompareType compareType, ConditionBase item1, ConditionBase item2) : base(null, null) { this.compareType = compareType; this.item1 = item1; this.item2 = item2; }