void PrepareTool(ControlNode node, bool drag)
 {
     if (node != null) {
         var tool = new CreateComponentTool(node.Type);
         if (Shell.Instance.CurrentDocument != null) {
             Shell.Instance.CurrentDocument.DesignContext.Services.Tool.CurrentTool = tool;
             if (drag) {
                 DragDrop.DoDragDrop(this, tool, DragDropEffects.Copy);
             }
         }
     }
 }
예제 #2
0
 void PrepareTool(ControlNode node, bool drag)
 {
     if (node != null)
     {
         var tool = new CreateComponentTool(node.Type);
         if (Shell.Instance.CurrentDocument != null)
         {
             Shell.Instance.CurrentDocument.DesignContext.Services.Tool.CurrentTool = tool;
             if (drag)
             {
                 DragDrop.DoDragDrop(this, tool, DragDropEffects.Copy);
             }
         }
     }
 }