예제 #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.Dispose();
            drawLayer = null;
        }
예제 #2
0
        /// <summary>
        /// 加载绘制矩形框插件
        /// </summary>
        public override void Load()
        {
            drawLayer      = new DrawRectangleLayer("矩形区域图层", Color.FromArgb(255, 255, 0, 0), this, ParentApplication.DrawArgs);
            drawLayer.IsOn = true;                                           //关闭WW自带响应事件
            ParentApplication.CurrentWorld.RenderableObjects.Add(drawLayer); //添加图层 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);
        }