// Returns false if something went wrong
 public override bool Paste(IBrowserNode node, bool isCopy)
 {
     try {
         // Save the object, cuz it may get removed if this is a cut
         Object cutCopyObj = ((ObjectTreeNode)node).Obj;
         // First, remove the old object from its parent.  This is
         // necessary to handle things like moving controls; they
         // will be upset if they are added to another node without
         // first removing them from the previous one.
         if (!isCopy)
         {
             node.RemoveLogicalNode();
         }
         if (AddObject(cutCopyObj) == null)
         {
             return(false);
         }
     } catch (Exception ex) {
         ErrorDialog.Show(ex,
                          "Exception during paste",
                          MessageBoxIcon.Error);
         return(false);
     }
     return(true);
 }
Пример #2
0
        internal void TreeNodePopupDelete(object sender, EventArgs e)
        {
            IBrowserNode node = (IBrowserNode)SelectedNode;

            if (node != null)
            {
                node.RemoveLogicalNode();
            }
        }
Пример #3
0
		// Returns false if something went wrong
		public override bool Paste(IBrowserNode node, bool isCopy)
		{
			try {
				// Save the object, cuz it may get removed if this is a cut
				Object cutCopyObj = ((ObjectTreeNode)node).Obj;
				// First, remove the old object from its parent.  This is
				// necessary to handle things like moving controls; they
				// will be upset if they are added to another node without
				// first removing them from the previous one.
				if (!isCopy)
					node.RemoveLogicalNode();
				if (AddObject(cutCopyObj) == null)
					return false;
			} catch (Exception ex) {
				ErrorDialog.Show(ex,
								"Exception during paste",
								MessageBoxIcon.Error);
				return false;
			}
			return true;
		}