Пример #1
0
        private void ShowSymbolSetForm(ColorBreak aCB)
        {
            switch (_legendScheme.ShapeType)
            {
            case ShapeTypes.Point:
                PointBreak aPB = (PointBreak)aCB;

                if (!_frmPointSymbolSet.Visible)
                {
                    _frmPointSymbolSet = new frmPointSymbolSet(this);
                    _frmPointSymbolSet.Show(this);
                }
                _frmPointSymbolSet.PointBreak = aPB;
                break;

            case ShapeTypes.Polyline:
            case ShapeTypes.PolylineZ:
                PolyLineBreak aPLB = (PolyLineBreak)aCB;

                if (!_frmPolylineSymbolSet.Visible)
                {
                    _frmPolylineSymbolSet = new frmPolylineSymbolSet(this);
                    _frmPolylineSymbolSet.Show(this);
                }
                _frmPolylineSymbolSet.PolylineBreak = aPLB;
                break;

            case ShapeTypes.Polygon:
                PolygonBreak aPGB = (PolygonBreak)aCB;

                if (!_frmPolygonSymbolSet.Visible)
                {
                    _frmPolygonSymbolSet = new frmPolygonSymbolSet(this);
                    _frmPolygonSymbolSet.Show(this);
                }
                _frmPolygonSymbolSet.PolygonBreak = aPGB;
                break;

            case ShapeTypes.Image:
                if (!_frmColorSymbolSet.Visible)
                {
                    _frmColorSymbolSet = new frmColorSymbolSet(this);
                    _frmColorSymbolSet.Show(this);
                }
                _frmColorSymbolSet.ColorBreak = aCB;
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LegendView()
        {
            InitializeComponent();

            this.SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer, true);
            this.BackColor    = Color.White;
            TB_Editor.Visible = false;

            _frmPointSymbolSet    = new frmPointSymbolSet(this);
            _frmPolylineSymbolSet = new frmPolylineSymbolSet(this);
            _frmPolygonSymbolSet  = new frmPolygonSymbolSet(this);
            _frmColorSymbolSet    = new frmColorSymbolSet(this);
            _legendScheme         = null;
            _breakHeight          = 20;
            _symbolWidth          = 60;
            _valueWidth           = (this.Width - _symbolWidth) / 2;
            _labelWidth           = _valueWidth;
        }