Esempio n. 1
0
        private void method_5(ICoFeature icoFeature_0, IFeature ifeature_0)
        {
            ICoAnnotationFeature feature  = icoFeature_0 as ICoAnnotationFeature;
            IAnnotationFeature   feature2 = ifeature_0 as IAnnotationFeature;

            if (((feature != null) && (feature2 != null)) && (feature2.Annotation != null))
            {
                ITextElement annotation = feature2.Annotation as ITextElement;
                if (annotation != null)
                {
                    IPoint geometry = ((IElement)annotation).Geometry as IPoint;
                    if (geometry != null)
                    {
                        feature.Point.Add(new CoPointClass(geometry.X, geometry.Y, geometry.Z));
                        feature.Text  = annotation.Text;
                        feature.Angle = annotation.Symbol.Angle;
                        feature.Color = Color.FromArgb(annotation.Symbol.Color.RGB);
                        FontStyle regular = FontStyle.Regular;
                        if (annotation.Symbol.Font.Bold)
                        {
                            regular = FontStyle.Bold;
                        }
                        if (annotation.Symbol.Font.Italic)
                        {
                            regular = FontStyle.Italic;
                        }
                        if (annotation.Symbol.Font.Strikethrough)
                        {
                            regular = FontStyle.Strikeout;
                        }
                        if (annotation.Symbol.Font.Underline)
                        {
                            regular = FontStyle.Underline;
                        }
                        System.Drawing.Font font = new System.Drawing.Font(annotation.Symbol.Font.Name,
                                                                           (float)annotation.Symbol.Font.Size, regular);
                        feature.Font = font;
                    }
                }
            }
        }
Esempio n. 2
0
        private IFeatureBuffer method_9(ICoFeature icoFeature_0)
        {
            object         before = Missing.Value;
            IFeatureBuffer buffer = null;

            if (this.bool_0)
            {
                buffer = this.ifeatureClass_0.CreateFeatureBuffer();
            }
            else
            {
                buffer = this.ifeatureClass_0.CreateFeature() as IFeatureBuffer;
            }
            if (buffer != null)
            {
                buffer.Shape = null;
            }
            switch (icoFeature_0.Type)
            {
            case CoFeatureType.Point:
                if ((this.ifeatureClass_0.FeatureType != esriFeatureType.esriFTAnnotation) &&
                    (this.ifeatureClass_0.ShapeType == esriGeometryType.esriGeometryPoint))
                {
                    foreach (IPoint point in this.method_15((icoFeature_0 as ICoPointFeature).Point))
                    {
                        buffer.Shape = point;
                    }
                }
                break;

            case CoFeatureType.Polygon:
                if ((this.ifeatureClass_0.FeatureType != esriFeatureType.esriFTAnnotation) &&
                    (this.ifeatureClass_0.ShapeType == esriGeometryType.esriGeometryPolygon))
                {
                    IGeometryCollection geometrys2 = new PolygonClass();
                    foreach (CoPointCollection points in (icoFeature_0 as ICoPolygonFeature).Points)
                    {
                        IPointCollection points3 = new RingClass();
                        foreach (IPoint point2 in this.method_15(points))
                        {
                            points3.AddPoint(point2, ref before, ref before);
                        }
                        geometrys2.AddGeometry((IGeometry)points3, ref before, ref before);
                    }
                    ((IPolygon)geometrys2).SimplifyPreserveFromTo();
                    buffer.Shape = (IGeometry)geometrys2;
                }
                break;

            case CoFeatureType.Annotation:
                if (this.ifeatureClass_0.FeatureType == esriFeatureType.esriFTAnnotation)
                {
                    IAnnotationFeature   feature  = buffer as IAnnotationFeature;
                    IPoint               point    = new PointClass();
                    ICoAnnotationFeature feature2 = icoFeature_0 as ICoAnnotationFeature;
                    point.X = feature2.Point[0].X;
                    point.Y = feature2.Point[0].Y;
                    point.Z = feature2.Point[0].Z;
                    ITextElement element = this.method_11(feature2.Text, 0.0, (decimal)feature2.Font.Size,
                                                          feature2.Font.Name, feature2.Color.ToArgb(), point);
                    feature.Annotation = (IElement)element;
                }
                break;

            case CoFeatureType.Polyline:
                if ((this.ifeatureClass_0.FeatureType != esriFeatureType.esriFTAnnotation) &&
                    (this.ifeatureClass_0.ShapeType == esriGeometryType.esriGeometryPolyline))
                {
                    IGeometryCollection geometrys = new PolylineClass();
                    foreach (CoPointCollection points in (icoFeature_0 as ICoPolylineFeature).Points)
                    {
                        IPoint[]         pointArray = this.method_15(points);
                        IPointCollection points2    = new PathClass();
                        for (int i = 0; i < pointArray.Length; i++)
                        {
                            points2.AddPoint(pointArray[i], ref before, ref before);
                        }
                        geometrys.AddGeometry((IGeometry)points2, ref before, ref before);
                    }
                    buffer.Shape = (IGeometry)geometrys;
                }
                break;
            }
            if (buffer != null)
            {
                if (buffer.Shape != null)
                {
                    this.method_10(buffer, icoFeature_0);
                    return(buffer);
                }
                return(null);
            }
            return(null);
        }