Last change
on this file since 3038 was
2868,
checked in by mkommend, 15 years ago
|
finished mapping from OperatorGraph to GraphVisualizationInfo (ticket #867)
|
File size:
1.6 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Text;
|
---|
4 |
|
---|
5 | namespace Netron.Diagramming.Core
|
---|
6 | {
|
---|
7 | // ----------------------------------------------------------------------
|
---|
8 | /// <summary>
|
---|
9 | /// The tool that performs the "cut" operation.
|
---|
10 | /// </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 | }
|
---|
24 |
|
---|
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;
|
---|
34 |
|
---|
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 | }
|
---|
41 | }
|
---|
42 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.