예제 #1
0
        public ResourceUnpack(XmlNode node, LinkUnpack linkUnpack)
        {
            _linkUnpack = linkUnpack;
            _xmlNode    = node;
            XmlAttribute attribute = (XmlAttribute)node.Attributes.GetNamedItem("Type");

            if (attribute != null)
            {
                _valid = Core.ResourceStore.ResourceTypes.Exist(attribute.InnerText);
                if (_valid)
                {
                    _resource = Core.ResourceStore.NewResourceTransient(attribute.InnerText);
                    XmlNode propertiesNode = node.FirstChild;
                    foreach (XmlNode propertyNode in propertiesNode.ChildNodes)
                    {
                        SetProperty(propertyNode);
                    }
                    XmlNode linksNode = propertiesNode.NextSibling;
                    foreach (XmlNode link in linksNode.ChildNodes)
                    {
                        AddLink(link);
                    }
                }
            }
        }
예제 #2
0
        private void AddLink(XmlNode node)
        {
            LinkUnpack linkUnpack = new LinkUnpack(node, this);

            if (linkUnpack.Valid)
            {
                _links.Add(linkUnpack);
            }
        }