/// <summary> /// Called when reading XML. /// </summary> /// <param name="reader">The reader.</param> protected virtual void OnReadXml(XmlReader reader) { string name = reader.Name; if (name != null) { if (name != "IgnoreBlank") { if (name != "Formula") { if (name == "Value") { this.expected = ValueObject.FromValue(Serializer.DeserializeObj(null, reader)); return; } if (name == "OffsetY") { this.rowOffset = (int)((int)Serializer.DeserializeObj(typeof(int), reader)); return; } if (name == "OffsetX") { this.columnOffset = (int)((int)Serializer.DeserializeObj(typeof(int), reader)); } return; } } else { this.ignoreBlank = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; } this.expected = ValueObject.FromFormula((string)(Serializer.DeserializeObj(typeof(string), reader) as string)); } }
/// <summary> /// Creates a new base condition with the specified expected content for the specified cell. /// </summary> /// <param name="expected">The expected object.</param> /// <param name="formula">The expected formula.</param> protected ConditionBase(object expected, string formula) { if (string.IsNullOrEmpty(formula)) { this.expected = ValueObject.FromValue(expected); } else { this.expected = ValueObject.FromFormula(formula); } this.rowOffset = 0; this.columnOffset = 0; }