Exemplo n.º 1
0
        public override bool Load(XmlNode entryNode)
        {
            if (!base.Load(entryNode))
            {
                return(false);
            }

            foreach (XmlNode node in entryNode.ChildNodes)
            {
                if (node.Name == "ProgID")
                {
                    ProgID = new ProgramID();
                    ProgID.Load(node);
                }

                else if (node.Name == "State")
                {
                    Enum.TryParse <States>(node.InnerText, out State);
                }

                //else if (node.Name == "Changed")
                //    bool.TryParse(node.InnerText, out Changed);
                else if (node.Name == "LastChangedTime")
                {
                    DateTime.TryParse(node.InnerText, out LastChangedTime);
                }
                else if (node.Name == "ChangedCount")
                {
                    int.TryParse(node.InnerText, out ChangedCount);
                }

                else if (node.Name == "Expiration")
                {
                    UInt64.TryParse(node.InnerText, out Expiration);
                }

                else if (node.Name == "HitCount")
                {
                    Int64.TryParse(node.InnerText, out HitCount);
                }


                else if (node.Name == "Backup")
                {
                    Backup = new FirewallRule();
                    if (!Backup.Load(node))
                    {
                        Backup = null;
                    }
                }
            }

            return(ProgID != null);
        }