示例#1
0
 public void UpdateRow(IRow pRow)
 {
     pRow.Value[pRow.Fields.FindField("TemplateName")] = _name;
     pRow.Value[pRow.Fields.FindField("AliasName")]    = _aliasName;
     pRow.Value[pRow.Fields.FindField("BaseName")]     = _baseName;
     pRow.Value[pRow.Fields.FindField("Dataset")]      = _datasetName;
     pRow.Value[pRow.Fields.FindField("FeatureType")]  = FeatureHelper.ConvertTypeToSimpleString(_featureType);
     pRow.Value[pRow.Fields.FindField("GeometryType")] = GeometryHelper.ConvertToString(_geometryType);
     if (_fields.Count == 0)
     {
         pRow.Value[pRow.Fields.FindField("FieldDefs")] = "";
     }
     else
     {
         pRow.Value[pRow.Fields.FindField("FieldDefs")] = JsonConvert.SerializeObject(_fields);
     }
     pRow.Store();
     _id = pRow.OID;
 }
示例#2
0
        public XmlNode ToXml(XmlDocument doc)
        {
            XmlNode templateNode = doc.CreateElement("Template");

            XmlAttribute nameAttribute = doc.CreateAttribute("Name");

            nameAttribute.Value = _name;
            templateNode.Attributes.Append(nameAttribute);

            nameAttribute       = doc.CreateAttribute("AliasName");
            nameAttribute.Value = _aliasName;
            templateNode.Attributes.Append(nameAttribute);

            nameAttribute       = doc.CreateAttribute("BaseName");
            nameAttribute.Value = _baseName;
            templateNode.Attributes.Append(nameAttribute);

            nameAttribute       = doc.CreateAttribute("Dataset");
            nameAttribute.Value = _datasetName;
            templateNode.Attributes.Append(nameAttribute);

            nameAttribute       = doc.CreateAttribute("FeatureType");
            nameAttribute.Value = FeatureHelper.ConvertTypeToSimpleString(_featureType);
            templateNode.Attributes.Append(nameAttribute);

            nameAttribute       = doc.CreateAttribute("GeometryType");
            nameAttribute.Value = GeometryHelper.ConvertToString(_geometryType);
            templateNode.Attributes.Append(nameAttribute);

            XmlNode fieldsNode = doc.CreateElement("Fields");

            foreach (IYTField ytField in _fields)
            {
                fieldsNode.AppendChild(ytField.ToXml(doc));
            }
            templateNode.AppendChild(fieldsNode);
            return(templateNode);
        }