Beispiel #1
0
 private static XElement SerializeCondition(CrawlingCondition condition)
 {
     return(new XElement("Condition",
                         new XAttribute("Guid", condition.Guid),
                         new XAttribute("FieldType", condition.FieldType.Name),
                         new XAttribute("ComparisonType", condition.ComparisonType.Key),
                         new XAttribute("Value", condition.Value)));
 }
Beispiel #2
0
        private static CrawlingCondition DeserializeCondition(XElement element)
        {
            CrawlingCondition condition = new CrawlingCondition
            {
                Guid           = (Guid)element.Attribute("Guid"),
                ComparisonType = CrawlingConditionComparisonType.Parse((string)element.Attribute("ComparisonType")),
                FieldType      = CrawlingConditionFieldType.Parse((string)element.Attribute("FieldType")),
                Value          = (string)element.Attribute("Value")
            };

            return(condition);
        }