Exemplo n.º 1
0
        public Function CreateNodeFromXml(XmlElement nodeElement, SaveContext context, ElementResolver resolver)
        {
            XmlNode idNode =
                nodeElement.ChildNodes.Cast <XmlNode>()
                .LastOrDefault(subNode => subNode.Name.Equals("ID"));

            if (idNode == null || idNode.Attributes == null)
            {
                return(null);
            }

            string id = idNode.Attributes[0].Value;

            string name = nodeElement.Attributes["nickname"].Value;

            Guid funcId;

            if (!Guid.TryParse(id, out funcId))
            {
                funcId = GuidUtility.Create(GuidUtility.UrlNamespace, name);
            }

            var node = customNodeManager.CreateCustomNodeInstance(funcId, name /*, isTestMode*/);

            node.Deserialize(nodeElement, context);
            return(node);
        }
Exemplo n.º 2
0
 protected override NodeModel ConstructNewNodeModel()
 {
     return(customNodeManager.CreateCustomNodeInstance(ID));
 }