public static Category Parse(XmlReader reader) { string xmlElement = reader.Name; Category category = new Category(); if(xmlElement == "category") category.Name = reader.GetAttribute("name"); else if (xmlElement == "publication") category.Name = reader.GetAttribute("categoryName"); category.InstanceString = reader.GetAttribute("instance"); category.ContainerString = reader.GetAttribute("container"); category.PublishTimeString = reader.GetAttribute("publishTime"); category.VersionString = reader.GetAttribute("version"); category.ExpireTypeString = reader.GetAttribute("expireType"); category.EndpointId = reader.GetAttribute("endpointId"); category.ExpiresString = reader.GetAttribute("expires"); if (category.IsContactCardCategory()) category.ContactCard = ContactCardCategory.Parse(reader); else if (category.IsStateCategory()) category.State = StateCategory.Parse(reader); while (reader.Name != xmlElement && reader.NodeType == XmlNodeType.EndElement) reader.Read(); return category; }
public static Category Create(string name) { if (String.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); Category category = new Category(); category.Name = name; return category; }
public bool IsSame(Category category) { return this.Name == category.Name && this.Instance == category.Instance && this.Container == category.Container; }
public void Process(Category category, string endpointId) { this.Process(new List<Category> { category }, endpointId); }