コード例 #1
0
        /// <summary>
        /// Displays symbology form of the appropriate type
        /// </summary>
        public static Form GetSymbologyForm(this IAppContext context, int layerHandle, IGeometryStyle options, bool applyDisabled)
        {
            Form form  = null;
            var  layer = context.Legend.Layers.ItemByHandle(layerHandle);

            var fs = layer.FeatureSet;

            if (fs == null)
            {
                return(null);
            }

            var type = fs.GeometryType;

            if (type == GeometryType.Point || type == GeometryType.MultiPoint)
            {
                form = new PointsForm(context.Legend, layer, options, applyDisabled);
            }
            else if (type == GeometryType.Polyline)
            {
                form = new LinesForm(context.Legend, layer, options, applyDisabled);
            }
            else if (type == GeometryType.Polygon)
            {
                form = new PolygonForm(context.Legend, layer, options, applyDisabled);
            }
            return(form);
        }
コード例 #2
0
        /// <summary>
        /// Displays symbology form of the appropriate type
        /// </summary>
        public static Form GetSymbologyForm(LegendControl.Legend legend, int layerHandle, ShpfileType type, ShapeDrawingOptions options, bool applyDisabled)
        {
            Form form    = null;
            var  shpType = Globals.ShapefileType2D(type);
            var  layer   = legend.Layers.ItemByHandle(layerHandle);

            if (shpType == ShpfileType.SHP_POINT || shpType == ShpfileType.SHP_MULTIPOINT)
            {
                form = new PointsForm(legend, layer, options, applyDisabled);
            }
            else if (shpType == ShpfileType.SHP_POLYLINE)
            {
                form = new LinesForm(legend, layer, options, applyDisabled);
            }
            else if (shpType == ShpfileType.SHP_POLYGON)
            {
                form = new PolygonsForm(legend, layer, options, applyDisabled);
            }
            return(form);
        }
コード例 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            PointsForm form = new PointsForm();

            form.Show(this);
        }