Пример #1
0
        public void AddAttributeByKeyValue(string key, string value)
        {
            var xmlAttribute = Doc.CreateAttribute(key);

            xmlAttribute.Value = value;
            if (!Attributes.ContainsKey(key))
            {
                Attributes.Add(key, xmlAttribute);
            }
            else
            {
                Attributes[key] = xmlAttribute;
            }
        }
Пример #2
0
        public GlymaXmlMap(Guid mapId)
        {
            var doctype = Doc.CreateDocumentType("model", null, "Compendium.dtd", null);

            Doc.AppendChild(doctype);

            var model = Doc.CreateElement(string.Empty, "model", string.Empty);
            var attr  = Doc.CreateAttribute("rootview");

            attr.Value = mapId.ToLongString();
            model.Attributes.Append(attr);
            Doc.AppendChild(model);


            //_xmlElementViews = Doc.CreateElement(string.Empty, "views", string.Empty);
            //model.AppendChild(_xmlElementViews);

            //_xmlElementNodes = Doc.CreateElement(string.Empty, "nodes", string.Empty);
            //model.AppendChild(_xmlElementNodes);

            //_xmlElementLinks = Doc.CreateElement(string.Empty, "links", string.Empty);
            //model.AppendChild(_xmlElementLinks);
        }
Пример #3
0
        public void AddInputNode(string nameId, string type, string value)
        {
            var inputNode = Doc.CreateElement("input");

            if (!string.IsNullOrEmpty(nameId))
            {
                var nameAttribute = Doc.CreateAttribute("name", nameId);
                inputNode.Attributes.Add(nameAttribute);

                var idAttribute = Doc.CreateAttribute("id", nameId);
                inputNode.Attributes.Add(idAttribute);
            }

            var hiddenAttribute = Doc.CreateAttribute("type", type);

            inputNode.Attributes.Add(hiddenAttribute);

            var valueAttribute = Doc.CreateAttribute("value", value);

            inputNode.Attributes.Add(valueAttribute);

            FormNode.AppendChild(inputNode);
        }