public static StateCategory Create(int availability) { StateCategory state = new StateCategory(); state.Availability = availability; return(state); }
public static StateCategory Create(int availability) { StateCategory state = new StateCategory(); state.Availability = availability; return state; }
public static StateCategory Parse(XmlReader reader) { StateCategory state = new StateCategory(); while (reader.Read()) { if (reader.Name == "availability") { while (reader.Read() && reader.NodeType != XmlNodeType.Text) ; state.Availability = reader.ReadContentAsInt(); } if (reader.Name == "state" && reader.NodeType == XmlNodeType.EndElement) break; } return state; }
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 StateCategory Parse(XmlReader reader) { StateCategory state = new StateCategory(); while (reader.Read()) { if (reader.Name == "availability") { while (reader.Read() && reader.NodeType != XmlNodeType.Text) { ; } state.Availability = reader.ReadContentAsInt(); } if (reader.Name == "state" && reader.NodeType == XmlNodeType.EndElement) { break; } } return(state); }