Esempio n. 1
0
        protected override void UpdateLayerStruct()
        {
            base.XpgisLayer.Fields.Clear();
            if (this.ifeatureClass_0 != null)
            {
                base.XpgisLayer.AliasName = this.ifeatureClass_0.AliasName;
                base.XpgisLayer.Name      = this.method_16(this.ifeatureClass_0 as IDataset);
                for (int i = 0; i < this.ifeatureClass_0.Fields.FieldCount; i++)
                {
                    ICoField item   = new CoFieldClass();
                    IField   field2 = this.ifeatureClass_0.Fields.get_Field(i);
                    switch (field2.Type)
                    {
                    case esriFieldType.esriFieldTypeSmallInteger:
                    case esriFieldType.esriFieldTypeInteger:
                    case esriFieldType.esriFieldTypeOID:
                        item.Type = CoFieldType.整型;
                        break;

                    case esriFieldType.esriFieldTypeSingle:
                    case esriFieldType.esriFieldTypeDouble:
                        item.Type = CoFieldType.浮点型;
                        break;

                    case esriFieldType.esriFieldTypeString:
                        item.Type = CoFieldType.字符型;
                        break;

                    case esriFieldType.esriFieldTypeDate:
                        item.Type = CoFieldType.日期型;
                        break;

                    case esriFieldType.esriFieldTypeBlob:
                        item.Type = CoFieldType.二进制;
                        break;
                    }
                    item.Name      = field2.Name;
                    item.AliasName = field2.AliasName;
                    item.Length    = field2.Length;
                    item.Precision = field2.Precision;
                    item.Required  = field2.Required;
                    base.XpgisLayer.Fields.Add(item);
                }
            }
        }
Esempio n. 2
0
        public static CoLayerMapper[] ReadXml(string string_0)
        {
            List <CoLayerMapper> list   = new List <CoLayerMapper>();
            XmlReaderClass       class2 = new XmlReaderClass(string_0);

            foreach (XmlNode node2 in class2.GetCustomSetting("configuration").ChildNodes)
            {
                ICoLayer layer = new CoLayerClass
                {
                    Name      = node2.Attributes["sName"].Value,
                    AliasName = node2.Attributes["sAliasName"].Value
                };
                ICoLayer layer2 = new CoLayerClass
                {
                    Name      = node2.Attributes["dName"].Value,
                    AliasName = node2.Attributes["dAliasName"].Value
                };
                CoLayerMapper item = new CoLayerMapper(layer, layer2);
                foreach (XmlNode node3 in node2.ChildNodes)
                {
                    ICoField field = new CoFieldClass
                    {
                        Name      = node3.Attributes["sName"].Value,
                        AliasName = node3.Attributes["sAliasName"].Value
                    };
                    ICoField field2 = new CoFieldClass
                    {
                        Name      = node3.Attributes["dName"].Value,
                        AliasName = node3.Attributes["dAliasName"].Value
                    };
                    item.FieldRelation.Add(new CoFieldMapper(field, field2));
                }
                list.Add(item);
            }
            return(list.ToArray());
        }