Esempio n. 1
0
        public FeatureOIDMap GetIndexByOID(int int_0)
        {
            if (!this.bool_0)
            {
                this.Sort();
            }
            FeatureOIDMap map  = new FeatureOIDMap(int_0);
            int           num  = 0;
            int           num2 = this.Count - 1;

            while (num < num2)
            {
                int           num3 = (num + num2) / 2;
                FeatureOIDMap map2 = this[num3] as FeatureOIDMap;
                if (map2.CompareTo(map) < 0)
                {
                    num = num3 + 1;
                }
                else
                {
                    if (map2.CompareTo(map) <= 0)
                    {
                        return(map2);
                    }
                    num2 = num3 - 1;
                }
            }
            return(this[num] as FeatureOIDMap);
        }
Esempio n. 2
0
        private FeatureOIDMap method_2(string string_5)
        {
            int result = 0;

            int.TryParse(string_5, out result);
            FeatureOIDMap map = new FeatureOIDMap(result);

            this.featureOIDMapCollection_0.Add(map);
            return(map);
        }
Esempio n. 3
0
        public int CompareTo(object object_0)
        {
            if (!(object_0 is FeatureOIDMap))
            {
                throw new Exception("对象不是有效的类型:" + typeof(FeatureOIDMap).ToString());
            }
            FeatureOIDMap map = object_0 as FeatureOIDMap;

            return(this.ObjectID - map.ObjectID);
        }
Esempio n. 4
0
        public void CreateMap()
        {
            try
            {
                string str2;
                string str3;
                int    num3;
                int    num4;
                this.arrayList_0.Clear();
                this.arrayList_1.Clear();
                this.arrayList_2.Clear();
                this.featureOIDMapCollection_0.Clear();
                ICoLayer[] layers = this.Layers;
                for (int i = 0; i < layers.Length; i++)
                {
                    this.arrayList_0.Add(null);
                    this.arrayList_1.Add(null);
                    this.arrayList_2.Add(null);
                }
                StreamReader reader = new StreamReader(this.string_0, Encoding.Default);
                string       str    = string.Empty;
                this.long_0            = 1L;
                this.dataFile.Position = 0L;
                this.dataFile.Map.Add(this.dataFile.Position);
                int  num2 = -1;
                bool flag = false;
                this.method_0(reader, "POINTBEGIN");
                while (!reader.EndOfStream)
                {
                    str2 = this.method_1(ref reader);
                    while (str2.Trim().Length <= 0)
                    {
                        str2 = this.method_1(ref reader);
                    }
                    if (str2.ToUpper().Trim() == "POINTEND")
                    {
                        goto Label_019F;
                    }
                    str3 = this.method_1(ref reader);
                    if (str != str3)
                    {
                        str  = str3;
                        num2 = this.FindLayerIndex(str, CoLayerType.Point);
                        if ((num2 != -1) && (this.arrayList_0[num2] == null))
                        {
                            this.arrayList_0[num2] = this.long_0 - 2L;
                        }
                    }
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                }
                goto Label_01A2;
Label_019F:
                flag = true;
Label_01A2:
                if (!flag)
                {
                    this.WriteLog(string.Format(this.string_2, "POINTBEGIN", "POINTEND"));
                }
                flag = false;
                str  = string.Empty;
                this.method_0(reader, "LINEBEGIN");
Label_01D7:
                if (!reader.EndOfStream)
                {
                    str2 = this.method_1(ref reader);
                    while (str2.Trim().Length <= 0)
                    {
                        str2 = this.method_1(ref reader);
                    }
                    FeatureOIDMap map = this.method_2(str2);
                    if (str2.ToUpper().Trim() != "LINEEND")
                    {
                        str3 = this.method_1(ref reader);
                        if (str != str3)
                        {
                            str  = str3;
                            num2 = this.FindLayerIndex(str, CoLayerType.Line);
                            if ((num2 != -1) && (this.arrayList_0[num2] == null))
                            {
                                this.arrayList_0[num2] = this.long_0 - 2L;
                            }
                        }
                        this.method_1(ref reader);
                        this.method_1(ref reader);
                        num3 = 0;
                        int.TryParse(this.method_1(ref reader).Trim(), out num3);
                        num4 = 0;
                        while (num4 < num3)
                        {
                            string str4 = this.method_1(ref reader);
                            try
                            {
                                CoPointClass class2 = this.LineToPoint(str4);
                                map.PointArray.Add(class2);
                            }
                            catch (Exception exception1)
                            {
                                this.WriteLog(str4 + "\r\n" + exception1.ToString());
                            }
                            num4++;
                        }
                        goto Label_01D7;
                    }
                    flag = true;
                }
                if (!flag)
                {
                    this.WriteLog(string.Format(this.string_2, "LINEBEGIN", "LINEEND"));
                }
                flag = false;
                str  = string.Empty;
                this.method_0(reader, "POLYGONBEGIN");
                while (!reader.EndOfStream)
                {
                    str2 = this.method_1(ref reader);
                    while (str2.Trim().Length <= 0)
                    {
                        str2 = this.method_1(ref reader);
                    }
                    if (str2.ToUpper().Trim() == "POLYGONEND")
                    {
                        goto Label_04DF;
                    }
                    str3 = this.method_1(ref reader);
                    if (str != str3)
                    {
                        str  = str3;
                        num2 = this.FindLayerIndex(str, CoLayerType.Region);
                        if ((num2 != -1) && (this.arrayList_0[num2] == null))
                        {
                            this.arrayList_0[num2] = this.long_0 - 2L;
                        }
                    }
                    string str5 = this.method_1(ref reader);
                    str5 = this.method_1(ref reader);
                    if (this.LineToPoint(str5) == null)
                    {
                        str5 = this.method_1(ref reader);
                    }
                    num3 = 0;
                    int.TryParse(this.method_1(ref reader).Trim(), out num3);
                    switch (this.coLayerHead_0.Topo)
                    {
                    case 0:
                        goto Label_048F;

                    case 1:
                    {
                        int num6 = num3 / 8;
                        if ((num3 % 8) > 0)
                        {
                            num6++;
                        }
                        num4 = 0;
                        while (num4 < num6)
                        {
                            this.method_1(ref reader);
                            num4++;
                        }
                        continue;
                    }

                    default:
                    {
                        continue;
                    }
                    }
Label_045E:
                    num4 = 0;
                    while (num4 < num3)
                    {
                        this.method_1(ref reader);
                        num4++;
                    }
                    int.TryParse(this.method_1(ref reader).Trim(), out num3);
Label_048F:
                    if (num3 != 0)
                    {
                        goto Label_045E;
                    }
                }
                goto Label_04E2;
Label_04DF:
                flag = true;
Label_04E2:
                if (!flag)
                {
                    this.WriteLog(string.Format(this.string_2, "POLYGONBEGIN", "POLYGONEND"));
                }
                flag = false;
                str  = string.Empty;
                this.method_0(reader, "ANNOTATIONBEGIN");
                while (!reader.EndOfStream)
                {
                    str2 = this.method_1(ref reader);
                    while (str2.Trim().Length <= 0)
                    {
                        str2 = this.method_1(ref reader);
                    }
                    if (str2.ToUpper().Trim() == "ANNOTATIONEND")
                    {
                        goto Label_0621;
                    }
                    str3 = this.method_1(ref reader);
                    if (str != str3)
                    {
                        str  = str3;
                        num2 = this.FindLayerIndex(str, CoLayerType.Annotation);
                        if ((num2 != -1) && (this.arrayList_0[num2] == null))
                        {
                            this.arrayList_0[num2] = this.long_0 - 2L;
                        }
                    }
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                    this.method_1(ref reader);
                }
                goto Label_0624;
Label_0621:
                flag = true;
Label_0624:
                if (!flag)
                {
                    this.WriteLog(string.Format(this.string_2, "ANNOTATIONBEGIN", "ANNOTATIONEND"));
                }
                flag = false;
                this.method_0(reader, "ATTRIBUTEBEGIN");
                while (!reader.EndOfStream)
                {
                    string str6 = this.method_1(ref reader);
                    while (str6.Trim().Length <= 0)
                    {
                        str6 = this.method_1(ref reader);
                    }
                    if (str6.Trim().ToUpper() == "ATTRIBUTEEND")
                    {
                        goto Label_073F;
                    }
                    num2 = this.FindLayerIndexByName(str6);
                    if (num2 != -1)
                    {
                        this.arrayList_1[num2] = this.long_0;
                    }
                    int num7 = 0;
                    for (string str7 = this.method_1(ref reader);
                         str7.Trim().ToUpper() != "TABLEEND";
                         str7 = this.method_1(ref reader))
                    {
                        if (str7.Trim().Length > 0)
                        {
                            num7++;
                        }
                    }
                    if (num2 != -1)
                    {
                        this.arrayList_2[num2] = num7;
                    }
                }
                goto Label_0742;
Label_073F:
                flag = true;
Label_0742:
                if (!flag)
                {
                    this.WriteLog(string.Format(this.string_2, "ATTRIBUTEBEGIN", "ATTRIBUTEEND"));
                }
                reader.Close();
                reader.Dispose();
                reader = null;
            }
            catch (Exception exception2)
            {
                this.WriteLog(exception2.ToString());
            }
        }