Exemplo n.º 1
0
        public override void Execute()
        {
            ICanvasViewer v = _smartSession.SmartWindowManager.ActiveCanvasViewer as ICanvasViewer;

            if (v == null)
            {
                return;
            }
            ICanvas      canvas = v.Canvas;
            MeasureLayer layer  = canvas.LayerContainer.GetByName("MeasureLayer") as MeasureLayer;

            if (layer != null)
            {
                layer.Dispose();
                canvas.LayerContainer.Layers.Remove(layer);
            }
            canvas.Refresh(enumRefreshType.FlyLayer);
        }
Exemplo n.º 2
0
        public override void Execute()
        {
            ICanvasViewer v = _smartSession.SmartWindowManager.ActiveCanvasViewer as ICanvasViewer;

            if (v == null)
            {
                return;
            }
            ICanvas      canvas = v.Canvas;
            MeasureLayer layer  = canvas.LayerContainer.GetByName("MeasureLayer") as MeasureLayer;

            if (layer == null)
            {
                layer      = new MeasureLayer();
                layer.Name = "MeasureLayer";
                canvas.LayerContainer.Layers.Add(layer);
            }
            layer.Visible = true;
            layer.Enabled = true;
            canvas.Refresh(enumRefreshType.FlyLayer);
        }