示例#1
0
        public void getIML(System.Xml.XmlDocument doc, System.Xml.XmlNode parentElem)
        {
            if (sourcePath == "#Crow.DefaultItem.template")
            {
                return;
            }

            XmlElement   xe = doc.CreateElement("ItemTemplate");
            XmlAttribute xa = null;

            if (string.IsNullOrEmpty(sourcePath))
            {
                //inline item template
                using (GraphicObject go = this.CreateInstance())
                    go.getIML(doc, xe);
            }
            else
            {
                xa       = doc.CreateAttribute("Path");
                xa.Value = sourcePath;
                xe.Attributes.Append(xa);
            }

            if (strDataType != "default")
            {
                xa       = doc.CreateAttribute("DataType");
                xa.Value = strDataType;
                xe.Attributes.Append(xa);

                if (dataTest != "TypeOf")
                {
                    xa       = doc.CreateAttribute("DataTest");
                    xa.Value = dataTest;
                    xe.Attributes.Append(xa);
                }
            }

            if (!string.IsNullOrEmpty(fetchMethodName))
            {
                xa       = doc.CreateAttribute("Data");
                xa.Value = fetchMethodName;
                xe.Attributes.Append(xa);
            }

            parentElem.AppendChild(xe);
        }