Esempio n. 1
0
        public void ReadFromXml(XmlNode xmlNode)
        {
            if (xmlNode.Attributes != null)
            {
                _name             = xmlNode.Attributes["Name"].Value;
                _baseName         = xmlNode.Attributes["BaseName"].Value;
                _aliasName        = xmlNode.Attributes["AliasName"].Value;
                _datasetName      = xmlNode.Attributes["Dataset"].Value;
                _geometryTypeName = xmlNode.Attributes["GeometryType"].Value;
                _geometryType     = string.IsNullOrEmpty(_geometryTypeName)
                    ? esriGeometryType.esriGeometryPoint
                    : GeometryHelper.ConvertFromString(_geometryTypeName);
                _featureTypeName = xmlNode.Attributes["FeatureType"].Value;
                _featureType     = string.IsNullOrEmpty(_featureTypeName)
                   ? esriFeatureType.esriFTSimple
                   : FeatureHelper.ConvertStringToFeatureType(_featureTypeName);
            }
            XmlNodeList nodeList =
                xmlNode.SelectNodes($"/ObjectTemplates/Template[@Name='{_name}']/Fields/Field");

            foreach (XmlNode node in nodeList)
            {
                YTField field = new YTField(node);
                _fields.Add(field);
            }
        }
Esempio n. 2
0
        public YTField(YTField pField)
        {
            _name          = pField.Name;
            _aliasName     = pField.AliasName;
            _length        = pField.Length;
            _precision     = pField.Precision;
            _fieldType     = pField.FieldType;
            _fieldTypeName = pField.FieldTypeName;
            _allowNull     = pField.AllowNull;
            _domain        = pField.DomainName;
            _isKey         = pField.IsKey;

            if (string.IsNullOrEmpty(_domain))
            {
                DomainName = pField.DomainName;
            }
        }
Esempio n. 3
0
        public YTField Clone(bool keepClass)
        {
            YTField newField = new YTField(this);

            return(newField);
        }