Esempio n. 1
0
 private void TreePanelEx_RemoteMove(object sender, RemoteMoveEventArgs e)
 {
     if (!EnableEdit)
     {
         return;
     }
     try
     {
         string[] source       = e.Nodes.ToArray();
         string   targetNodeID = e.TargetNodeID;
         if (source.Contains <string>(targetNodeID))
         {
             throw new ArgumentException("不能移动到自身");
         }
         int target = Convert.ToInt32(targetNodeID);
         this._nodeHelper.ChangeParent(source, target);
         //int num2 = this._nodeHelper.GetItemLevel(target) + 1;
         foreach (string str2 in source)
         {
             NodeProxy nodeById = this.GetNodeById(str2);
             nodeById.Set("ParentId", target);
             // nodeById.Set("Level", num2);
         }
         e.Accept = true;
     }
     catch (ArgumentException exception)
     {
         this.ShowError(exception.Message, e);
     }
     catch (DbException exception2)
     {
         this.ShowError(exception2.Message, e);
     }
 }