System.Xml.XmlDocument.CreateElement C# (CSharp) 메소드

CreateElement() 공개 메소드

public CreateElement ( String name ) : XmlElement
name String
리턴 XmlElement
        public XmlElement CreateElement(String name)
        {
            string prefix = String.Empty;
            string localName = String.Empty;
            SplitName(name, out prefix, out localName);
            return CreateElement(prefix, localName, string.Empty);
        }

Same methods

XmlDocument::CreateElement ( String qualifiedName, String namespaceURI ) : XmlElement
XmlDocument::CreateElement ( string prefix, string localName, string namespaceURI ) : XmlElement

Usage Example

예제 #1
1
파일: Function.cs 프로젝트: khoaho/Dynamo
        protected override void SaveNode(XmlDocument xmlDoc, XmlElement nodeElement, SaveContext context)
        {
            Controller.SaveNode(xmlDoc, nodeElement, context);
            
            var outEl = xmlDoc.CreateElement("Name");
            outEl.SetAttribute("value", NickName);
            nodeElement.AppendChild(outEl);

            outEl = xmlDoc.CreateElement("Description");
            outEl.SetAttribute("value", Description);
            nodeElement.AppendChild(outEl);

            outEl = xmlDoc.CreateElement("Inputs");
            foreach (string input in InPortData.Select(x => x.NickName))
            {
                XmlElement inputEl = xmlDoc.CreateElement("Input");
                inputEl.SetAttribute("value", input);
                outEl.AppendChild(inputEl);
            }
            nodeElement.AppendChild(outEl);

            outEl = xmlDoc.CreateElement("Outputs");
            foreach (string output in OutPortData.Select(x => x.NickName))
            {
                XmlElement outputEl = xmlDoc.CreateElement("Output");
                outputEl.SetAttribute("value", output);
                outEl.AppendChild(outputEl);
            }
            nodeElement.AppendChild(outEl);
        }
All Usage Examples Of System.Xml.XmlDocument::CreateElement