Esempio n. 1
0
        public static StateCategory Create(int availability)
        {
            StateCategory state = new StateCategory();

            state.Availability = availability;

            return(state);
        }
Esempio n. 2
0
        public static StateCategory Create(int availability)
        {
            StateCategory state = new StateCategory();

            state.Availability = availability;

            return state;
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }