Ejemplo n.º 1
0
        /// <summary>
        /// 卸载插件
        /// </summary>
        public override void Unload()
        {
            ParentApplication.MouseMove        -= new MouseEventHandler(drawLayer.MouseMove);
            ParentApplication.MouseDown        -= new MouseEventHandler(drawLayer.MouseDown);
            ParentApplication.MouseUp          -= new MouseEventHandler(drawLayer.MouseUp);
            ParentApplication.MouseDoubleClick -= new MouseEventHandler(drawLayer.MouseDoubleClick);
            ParentApplication.KeyUp            -= new KeyEventHandler(drawLayer.KeyUp);

            ParentApplication.CurrentWorld.RenderableObjects.Remove(drawLayer);
            m_isLoaded             = false;
            drawLayer.OnCompleted -= new EventHandler(drawLayer_OnCompleted);
            drawLayer.OnPolyUp    -= new EventHandler(drawLayer_OnPolyUp);
            drawLayer.Dispose();
            drawLayer = null;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 加载工具
        /// </summary>
        public override void Load()
        {
            drawLayer      = new DrawPolylineLayer("多线段图层", Color.FromArgb(255, 255, 0, 0), this, ParentApplication.DrawArgs);
            drawLayer.IsOn = true;      //关闭WW自带响应事件
            ParentApplication.CurrentWorld.RenderableObjects.Add(drawLayer);

            // Subscribe events
            ParentApplication.MouseMove        += new MouseEventHandler(drawLayer.MouseMove);
            ParentApplication.MouseDown        += new MouseEventHandler(drawLayer.MouseDown);
            ParentApplication.MouseUp          += new MouseEventHandler(drawLayer.MouseUp);
            ParentApplication.MouseDoubleClick += new MouseEventHandler(drawLayer.MouseDoubleClick);
            ParentApplication.KeyUp            += new KeyEventHandler(drawLayer.KeyUp);
            drawLayer.OnCompleted += new EventHandler(drawLayer_OnCompleted);
            drawLayer.OnPolyUp    += new EventHandler(drawLayer_OnPolyUp);
        }