예제 #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this.activeTool != null)
                {
                    this.activeTool.Dispose();
                    this.activeTool = null;
                }
            }

            base.Dispose(disposing);
        }
예제 #2
0
        public void UpdateStatusBarToToolHelpText(Tool tool)
        {
            if (tool == null)
            {
                SetStatus(string.Empty, null);
            }
            else
            {
                string toolName = tool.Name;
                string helpText = tool.HelpText;

                string contextFormat = PdnResources.GetString("StatusBar.Context.Help.Text.Format");
                string contextText = string.Format(contextFormat, toolName, helpText);

                SetStatus(contextText, PdnResources.GetImageResource("Icons.MenuHelpHelpTopicsIcon.png"));
            }
        }
예제 #3
0
 public ToolClickedEventArgs(Tool tool)
 {
     this.toolType = tool.GetType();
 }
예제 #4
0
        public void SetTool(Tool copyMe)
        {
            OnToolChanging();

            if (this.activeTool != null)
            {
                this.previousActiveToolType = this.activeTool.GetType();
                this.activeTool.CursorChanged -= ToolCursorChangedHandler;
                this.activeTool.PerformDeactivate();
                this.activeTool.Dispose();
                this.activeTool = null;
            }

            if (copyMe == null)
            {
                EnableToolPulse = false;
            }
            else
            {
                Tracing.LogFeature("SetTool(" + copyMe.GetType().FullName + ")");
                this.activeTool = CreateTool(copyMe.GetType());
                this.activeTool.PerformActivate();
                this.activeTool.CursorChanged += ToolCursorChangedHandler;

                if (this.suspendToolCursorChanges <= 0)
                {
                    Cursor = this.activeTool.Cursor;
                }

                EnableToolPulse = true;
            }

            OnToolChanged();
        }
예제 #5
0
 public ToolClickedEventArgs(Tool tool)
 {
     this.toolType = tool.GetType();
 }