Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Tools/CutTool.cs
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Tools/CutTool.cs
r2868 r4068 1 using System;2 using System.Collections.Generic;3 using System.Text;4 1 5 namespace Netron.Diagramming.Core 6 { 7 // ---------------------------------------------------------------------- 2 namespace Netron.Diagramming.Core { 3 // ---------------------------------------------------------------------- 4 /// <summary> 5 /// The tool that performs the "cut" operation. 6 /// </summary> 7 // ---------------------------------------------------------------------- 8 public class CutTool : AbstractTool { 9 // ------------------------------------------------------------------ 8 10 /// <summary> 9 /// The tool that performs the "cut" operation.11 /// Constructor. 10 12 /// </summary> 11 // ---------------------------------------------------------------------- 12 public class CutTool : AbstractTool 13 { 14 // ------------------------------------------------------------------ 15 /// <summary> 16 /// Constructor. 17 /// </summary> 18 /// <param name="toolName">string: The name of this tool.</param> 19 // ------------------------------------------------------------------ 20 public CutTool(string toolName) 21 : base(toolName) 22 { 23 } 13 /// <param name="toolName">string: The name of this tool.</param> 14 // ------------------------------------------------------------------ 15 public CutTool(string toolName) 16 : base(toolName) { 17 } 24 18 25 // ------------------------------------------------------------------ 26 /// <summary> 27 /// Called when the tool is activated. 28 /// </summary> 29 // ------------------------------------------------------------------ 30 protected override void OnActivateTool() 31 { 32 if (this.Controller.Model.Selection.SelectedItems.Count == 0) 33 return; 19 // ------------------------------------------------------------------ 20 /// <summary> 21 /// Called when the tool is activated. 22 /// </summary> 23 // ------------------------------------------------------------------ 24 protected override void OnActivateTool() { 25 if (this.Controller.Model.Selection.SelectedItems.Count == 0) 26 return; 34 27 35 // How about for the cut, if we use two existing tools. First, 36 // activate the copy tool, then activate the delete tool. That's 37 // essentially a cut operation, right? 38 Controller.ActivateTool(ControllerBase.CopyToolName); 39 Controller.ActivateTool(ControllerBase.DeleteToolName); 40 } 28 // How about for the cut, if we use two existing tools. First, 29 // activate the copy tool, then activate the delete tool. That's 30 // essentially a cut operation, right? 31 Controller.ActivateTool(ControllerBase.CopyToolName); 32 Controller.ActivateTool(ControllerBase.DeleteToolName); 41 33 } 34 } 42 35 }
Note: See TracChangeset
for help on using the changeset viewer.