Ejemplo n.º 1
0
        public void Init(XmlNode PropInfo, OnSetAnchor onSetAnchor, OnAddAnchorPropertyTex AddAnchorPropertyTexEvnt,
                         OnAddAnchorPropertyXML onAddAnchorPropertyXML, OnRemoveAnchorPropertyXML onRemoveAnchorPropertyXML, AnchorAddXMLEvnt onAnchorAdd,
                         IsLoadProcessDelegate IsLoadProcess)
        {
            propinfo                   = PropInfo;
            _onSetAnchor               = onSetAnchor;
            _onAddAnchorPropertyTex    = AddAnchorPropertyTexEvnt;
            _onAddAnchorPropertyXML    = onAddAnchorPropertyXML;
            _onRemoveAnchorPropertyXML = onRemoveAnchorPropertyXML;
            _onAnchorAdd               = onAnchorAdd;
            isLoadProcess              = IsLoadProcess;
            Anchors.Clear();

            if (propinfo != null && propinfo.HasChildNodes)
            {
                XmlNode aAnchors = propinfo.SelectSingleNode(".//" + "aAnchors");
                XmlNode AnchorItem;
                XmlNode AnchorProps = propinfo.SelectSingleNode(".//" + "aPropMetaData");
                int     LoadedProps = 0;
                for (int i = 0; i < aAnchors.ChildNodes.Count; i++)
                {
                    AnchorItem = aAnchors.ChildNodes[i];
                    if (AnchorItem.Name == "Item")
                    {
                        Anchor anchor = new Anchor(Anchors.Count);
                        Anchors.Add(anchor);
                        anchor.Init(AnchorItem, AnchorProps, onSetAnchor, _onAddAnchorPropertyTex, _onAddAnchorPropertyXML, _onRemoveAnchorPropertyXML, IsLoadProcess);
                        LoadedProps += anchor.Properties.Count;
                        _onSetAnchor(anchor.Id, anchor);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void Init(XmlNode AnchorNode, XmlNode AnchorProps, OnSetAnchor onSetAnchor, OnAddAnchorPropertyTex AddAnchorPropertyTexEvnt,
                         OnAddAnchorPropertyXML onAddAnchorPropertyXML, OnRemoveAnchorPropertyXML onRemoveAnchorPropertyXML, IsLoadProcessDelegate isLoadProcess)
        {
            AnchorXml                  = AnchorNode;
            AnchorPropsXml             = AnchorProps;
            _onSetAnchor               = onSetAnchor;
            _onAddAnchorPropertyTex    = AddAnchorPropertyTexEvnt;
            _onAddAnchorPropertyXML    = onAddAnchorPropertyXML;
            _onRemoveAnchorPropertyXML = onRemoveAnchorPropertyXML;
            _isLoadProcess             = isLoadProcess;

            Properties.Clear();
            XmlNode prop_node = AnchorXml.SelectSingleNode(".//" + "props");

            if (prop_node != null)
            {
                ParseAnchorProps(prop_node.InnerText);
            }
            XmlNode anchor_type = AnchorNode.SelectSingleNode(".//" + "anchor");

            AnchorName = AnchorNameFromAnchorTypes(anchor_type != null ? anchor_type.InnerText : "");
            for (int j = 0; j < AnchorPropsXml.ChildNodes.Count; j++)
            {
                XmlNode CurrProperty = AnchorProps.ChildNodes[j];
                if (CurrProperty.Name == "Item")
                {
                    XmlNode    anchorId = CurrProperty.SelectSingleNode(".//" + "anchorId");
                    XmlElement element3 = (XmlElement)anchorId;
                    int        anchorID = anchorId != null?Convert.ToInt32(element3.GetAttributeNode("value").InnerXml) : -1;

                    if (anchorID == Id)
                    {
                        SetProperty(CurrProperty);
                    }
                }
            }
        }