Exemplo n.º 1
0
        public ICoFeature GeometryToXpgisFeature(IGeometry igeometry_0)
        {
            if (igeometry_0 == null)
            {
                return(null);
            }
            ICoFeature feature2 = null;

            switch (igeometry_0.GeometryType)
            {
            case esriGeometryType.esriGeometryPoint:
                feature2 = CoFeatureFactory.CreateFeature(this.icoLayer_0, CoFeatureType.Point);
                break;

            case esriGeometryType.esriGeometryPolyline:
                feature2 = CoFeatureFactory.CreateFeature(this.icoLayer_0, CoFeatureType.Polyline);
                break;

            case esriGeometryType.esriGeometryPolygon:
                feature2 = CoFeatureFactory.CreateFeature(this.icoLayer_0, CoFeatureType.Polygon);
                break;
            }
            if (feature2 != null)
            {
                switch (feature2.Type)
                {
                case CoFeatureType.Point:
                    this.method_2(feature2, igeometry_0);
                    return(feature2);

                case CoFeatureType.Line:
                    return(feature2);

                case CoFeatureType.Polygon:
                    this.method_0(feature2, igeometry_0);
                    return(feature2);

                case CoFeatureType.Annotation:
                    this.method_3(feature2, igeometry_0);
                    return(feature2);

                case CoFeatureType.Polyline:
                    this.method_1(feature2, igeometry_0);
                    return(feature2);
                }
            }
            return(feature2);
        }
Exemplo n.º 2
0
        private ICoFeature method_0(IFeature ifeature_0)
        {
            if ((ifeature_0 == null) || (ifeature_0.Shape == null))
            {
                if (ifeature_0.HasOID)
                {
                    Debug.WriteLine("丢失要素:" + ifeature_0.OID.ToString());
                }
                else
                {
                    Debug.WriteLine("丢失要素:" + ifeature_0.ToString());
                }
                return(null);
            }
            ICoFeature    feature2 = null;
            IFeatureClass class2   = ifeature_0.Class as IFeatureClass;

            if (class2 != null)
            {
                switch (class2.FeatureType)
                {
                case esriFeatureType.esriFTSimple:
                    switch (ifeature_0.Shape.GeometryType)
                    {
                    case esriGeometryType.esriGeometryPoint:
                        feature2 = CoFeatureFactory.CreateFeature(base.XpgisLayer, CoFeatureType.Point);
                        goto Label_00E5;

                    case esriGeometryType.esriGeometryMultipoint:
                        goto Label_00E5;

                    case esriGeometryType.esriGeometryPolyline:
                        feature2 = CoFeatureFactory.CreateFeature(base.XpgisLayer, CoFeatureType.Polyline);
                        goto Label_00E5;

                    case esriGeometryType.esriGeometryPolygon:
                        feature2 = CoFeatureFactory.CreateFeature(base.XpgisLayer, CoFeatureType.Polygon);
                        goto Label_00E5;
                    }
                    break;

                case esriFeatureType.esriFTAnnotation:
                    feature2 = CoFeatureFactory.CreateFeature(base.XpgisLayer, CoFeatureType.Annotation);
                    break;
                }
            }
Label_00E5:
            if (feature2 != null)
            {
                switch (feature2.Type)
                {
                case CoFeatureType.Point:
                    this.method_4(feature2, ifeature_0);
                    break;

                case CoFeatureType.Polygon:
                    this.method_2(feature2, ifeature_0);
                    break;

                case CoFeatureType.Annotation:
                    this.method_5(feature2, ifeature_0);
                    break;

                case CoFeatureType.Polyline:
                    this.method_3(feature2, ifeature_0);
                    break;
                }
            }
            this.method_1(feature2, ifeature_0);
            return(feature2);
        }