Пример #1
0
	void TreeView_AfterLabelEdit (object sender, NodeLabelEditEventArgs e)
	{
		if (e.Label == null)
			return;

		if (e.Label == "REFUSE") {
			e.CancelEdit = true;
			e.Node.BeginEdit ();
		}
	}
Пример #2
0
        private void TreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            Element element = dicom[Key(e.Node.Name)];

            try
            {
                // a cancelled edit leaves e.Label null
                if (element != null && e.Label != null)
                {
                    element.Value = e.Label;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                e.CancelEdit = true;
            }
        }
Пример #3
0
        public static void cancelNodeCreation(NodeLabelEditEventArgs e, string btnSettingsClick)
        {
            TreeNode parent = new TreeNode();

            if (btnSettingsClick == Constantes.addTopic)
            {
                parent = e.Node.Parent;
            }
            else
            {
                parent = null;
            }
            e.Node.TreeView.Nodes.Remove(e.Node);
            if (parent != null && parent.Nodes.Count == 0)
            {
                parent.Collapse();
            }
        }
Пример #4
0
        private void treeViewWorkplace_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.CancelEdit)
            {
                return;
            }

            if (e.Node.Tag is FileSystemProperties)
            {
                FileSystemProperties file = treeViewWorkplace.SelectedNode.Tag as FileSystemProperties;
                if (e.Label.Equals(Path.GetFileName(file.FullName)))
                {
                    return;
                }

                file.MoveTo(Path.Combine(file.FullName, e.Label));
            }
        }
Пример #5
0
        private void tImg_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label == null || e.Label.Length == 0)
            {
                e.CancelEdit   = true;
                tImg.LabelEdit = false;
                return;
            }

            var ii = tImg.SelectedNode.Tag as ImageInfo;

            if (!ii.Rename(e.Label))
            {
                e.CancelEdit = true;
            }

            tImg.LabelEdit = false;
        }
Пример #6
0
        /// <summary>
        /// Gets the commit for the edit label event.
        /// Return <code>null</code> and cancels the edit if edit is not allowed.
        /// </summary>
        /// <param name="e">The <see cref="NodeLabelEditEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        private static ClassCommit GetCommitForEditLabel(NodeLabelEditEventArgs e)
        {
            if (e.Node == null)
            {
                e.CancelEdit = true;
                return(null);
            }

            var commit = e.Node.Tag as ClassCommit;

            if (commit == null || commit.IsDefault)
            {
                e.CancelEdit = true;
                return(null);
            }

            return(commit);
        }
Пример #7
0
 private void treeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null && treeView.Nodes.Count > 1 && e.Node == treeView.Nodes[1].Nodes[treeView.Nodes[1].Nodes.Count - 1] && e.Label != "Добавить тег")
     {
         SQLiteCommand command = new SQLiteCommand("INSERT INTO tags(name) VALUES (@name)", connection);
         command.Parameters.AddWithValue("@name", e.Label);
         command.ExecuteNonQuery();
         loadTreeView();
     }
     else if (e.Label != null && treeView.Nodes.Count > 1 && treeView.Nodes[1].Nodes.Contains(e.Node) && e.Label != "Добавить тег")
     {
         SQLiteCommand command = new SQLiteCommand("UPDATE tags SET name=@name WHERE id=@id", connection);
         command.Parameters.AddWithValue("@name", e.Label);
         command.Parameters.AddWithValue("@id", e.Node.Tag);
         command.ExecuteNonQuery();
         loadTreeView();
     }
 }
Пример #8
0
        private void tvAspects_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            try
            {
                tvAspectLabelEditing = false;
                if (e.CancelEdit || e.Label == null || e.Label == "")
                {
                    return;
                }
                Adapter.RenameNode(e.Node, e.Label);

                SynchronizeUndoButtons();
            }
            catch (Exception exc)
            {
                ExceptionInfoHelper.ShowInfo(exc);
            }
        }
        private void tvArbolGeneral_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                return;
            }

            //Se cambio el Nombre dentro del Arbol
            parametros = "V2=" + e.Node.Tag.ToString() + "|V3=" + e.Label + "|" +
                         "|C1=" + Clases.vGlobales.id_User +
                         "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString();;
            validar = "31";
            Datos   = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!Datos.bOk)
            {
                MessageBox.Show("No se puedo renombrar el Nodo", "Protección del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Пример #10
0
        void treeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            treeView.LabelEdit = false;

            Dictionary <String, List <String> > vDict = _pixmapManage.getData();

            if (e.Label != null)
            {
                if (vDict.ContainsKey(e.Label))
                {
                    e.CancelEdit = true;
                    return;
                }

                _pixmapManage.renameClass(e.Node.Text, e.Label);
                saveIconInfo();
            }
        }
Пример #11
0
 private void LstContas_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null)
     {
         if (e.Node.Tag.ToString().Substring(0, 1) == "G")
         {
             GrpAtiv.LerDados(int.Parse(e.Node.Tag.ToString().Substring(1, 3)));
             GrpAtiv.Grupo = e.Label;
             GrpAtiv.GravarDados();
         }
         if (e.Node.Tag.ToString().Substring(0, 1) == "C")
         {
             CadAtiv.LerDados(int.Parse(e.Node.Tag.ToString().Substring(1, 3)));
             CadAtiv.Atividade = e.Label;
             CadAtiv.GravarDados();
         }
     }
 }
Пример #12
0
        protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            _menu.SetNode(SelectedNode);
            if (string.IsNullOrWhiteSpace(e.Label))
            {
                e.CancelEdit = true;
                return;
            }
            SelectedNode = e.Node;
            var editableNode = e.Node as EditableNode;

            if (editableNode != null)
            {
                editableNode.AfterEdit(e);
            }

            base.OnAfterLabelEdit(e);
        }
Пример #13
0
        private void classesTreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.Label))
            {
                var node = e.Node as ClassTreeNode;
                if (node != null)
                {
                    node.ClassNode.Name = e.Label;

                    // Cancel the edit if the class refused the name.
                    // This prevents the tree node from using the wrong name.
                    if (node.ClassNode.Name != e.Label)
                    {
                        e.CancelEdit = true;
                    }
                }
            }
        }
Пример #14
0
 /// <summary>User has finished renamed a node.</summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="NodeLabelEditEventArgs"/> instance containing the event data.</param>
 private void OnAfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     TreeView.ContextMenuStrip = this.PopupMenu;
     if (Renamed != null && e.Label != null)
     {
         NodeRenameArgs args = new NodeRenameArgs()
         {
             NodePath = this.nodePathBeforeRename,
             NewName  = e.Label
         };
         Renamed(this, args);
         e.CancelEdit = args.CancelEdit;
         if (!e.CancelEdit)
         {
             previouslySelectedNodePath = args.NodePath;
         }
     }
 }
Пример #15
0
        void TreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            Node.TreeView.AfterLabelEdit -= new NodeLabelEditEventHandler(TreeView_AfterLabelEdit);
            Node.TreeView.LabelEdit       = false;

            try
            {
                if (!string.IsNullOrWhiteSpace(e.Label))
                {
                    this.Contract.Rename(e.Label);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "重新命名失敗", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.CancelEdit = true;
            }
        }
Пример #16
0
        void TreeViewNodeRename_Event(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label != null)
            {
                if (e.Node.Parent == null)
                {
                    group_rename(e.Node.Text, e.Label);
                    e.Node.Name = e.Label;
                }
                else
                {
                    pattern_rename(e.Node.Parent.Text, e.Node.Text, e.Label);
                    e.Node.Name = e.Label;

                    update();
                }
            }
        }
Пример #17
0
        private void trvFiles_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (!e.CancelEdit && e.Label != null)
            {
                e.Node.Text = e.Label;

                if (e.Node.Tag != null)
                {
                    var sub = e.Node.Tag as SubfileHolder;
                    sub.Name = e.Label;

                    SetAutoIcon(e.Node);
                }
                IsModified = true;

                ReloadInfo();
            }
        }
Пример #18
0
        private void fileTreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Node.Tag is ArchiveFolder)
            {
                var folder = e.Node.Tag as ArchiveFolder;
                folder.Name = e.Label;
                e.Node.Name = e.Label;
                return;
            }

            if (e.Node.Tag is ArchiveFile)
            {
                var file = e.Node.Tag as ArchiveFile;
                file.Name   = e.Label;
                e.Node.Name = e.Label;
                return;
            }
        }
Пример #19
0
 private void tree_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null)
     {
         Base   c        = e.Node.Tag as Base;
         string saveName = c.Name;
         try
         {
             c.Name = e.Label;
             Designer.SetModified(this, "Change");
         }
         catch (Exception ex)
         {
             FRMessageBox.Error(ex.Message);
             e.CancelEdit = true;
         }
     }
 }
        private void treeMapList_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (!mCanEdit)
            {
                return;
            }

            if (e.Node != null)
            {
                if (e.Node.Tag.GetType() == typeof(MapListMap))
                {
                    if (e.Node.Text == ((MapListMap)e.Node.Tag).Name && Chronological)
                    {
                        e.Node.Text = ((MapListMap)e.Node.Tag).Name;
                    }
                }
            }
        }
Пример #21
0
 private void treeViewReceitas_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null)
     {
         if (e.Node.Tag is Dominio.CentroCustos)
         {
             Dominio.CentroCustos custos = (Dominio.CentroCustos)e.Node.Tag;
             custos.Descricao = e.Label;
             new Repositorio.RepositorioCentroCustos().AtualizarObjeto(custos);
         }
         else
         {
             Dominio.Categoria cat = (Dominio.Categoria)e.Node.Tag;
             cat.Descricao = e.Label;
             new Repositorio.RepositorioCategoria().AtualizarObjeto(cat);
         }
     }
 }
Пример #22
0
 private void tvCategory_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label == null)
     {
         if (string.IsNullOrEmpty(SelectNodeViewText))
         {
             //表示没有进行修改
             e.Node.Remove();
         }
         else
         {
             e.CancelEdit = true;
         }
         return;
     }
     if (e.Label.ToString().Trim() == "")
     {
         e.CancelEdit = true;
         return;
     }
     if (dictList.Where(q => q.CategoryName.Value == e.Label.Trim() && q.CategoryName.Value != SelectNodeViewText).FirstOrDefault() != null)
     {
         e.CancelEdit = true;
         WinFormLib.Core.MessageBoxHelper.ShowError("分类已存在!");
         return;
     }
     if (!string.IsNullOrEmpty(SelectNodeViewText))
     {
         Dict dicEntity = dictList.Where(q => q.CategoryName.Value == SelectNodeViewText).FirstOrDefault();
         if (dicEntity != null)
         {
             dicEntity.CategoryName = e.Label.Trim();
         }
     }
     else
     {
         dictList.Add(new Dict()
         {
             CategoryName = CDataItem.Instance(e.Label.Trim()),
             DictItemList = new List <DictItem>()
         });
     }
     SelectNodeViewText = string.Empty;
 }
        private void motifTreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            e.CancelEdit = true; //RenameMotifAction will edit the name later
            this.motifTreeView.LabelEdit = false;

            string newtext = e.Label;
            string oldtext = e.Node.Text;

            if (newtext == null || newtext == "")
            {
                return;
            }

            //Eliminate all spaces at the beginning of the newtext
            while (newtext[0] == ' ')
            {
                newtext = newtext.Substring(1);
            }

            //If no changes in name or new name is empty, cancel edit
            if (newtext == oldtext || newtext == "")
            {
                return;
            }


            if (controller.getMotifFromName(newtext) != null)
            {
                MessageBox.Show(
                    "Ya existe un motivo con el nombre " + e.Label + ".",
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                return;
            }

            Motif         motif  = controller.getMotifFromName(e.Node.Text);
            ProgramAction action = new RenameMotifAction(this.controller, motif, e.Label);

            this.controller.executeAction(action);
            mnUndo.Enabled = true;
            mnRedo.Enabled = false;
        }
Пример #24
0
        private void tv_nds_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label != null)
            {
                if (e.Label.Length > 0)
                {
                    if (e.Label.IndexOfAny(new char[] { '@', '.', ',', '!' }) == -1)
                    {
                        // Stop editing without canceling the label change.
                        e.Node.EndEdit(false);

                        var dir = e.Node.Tag as NestDirectory;
                        dir.Name   = e.Label;
                        e.Node.Tag = dir;
                        if (e.Node.Parent != null)
                        {
                            var pDir = e.Node.Parent.Tag as NestDirectory;
                            var cDir = pDir.Children.FirstOrDefault(x => x.OrderIndex == dir.OrderIndex);
                            cDir.Name         = e.Label;
                            e.Node.Parent.Tag = pDir;
                        }
                    }
                    else
                    {
                        /* Cancel the label edit action, inform the user, and
                         * place the node in edit mode again. */
                        e.CancelEdit = true;
                        MessageBox.Show("名称不能包含无效字符.\n" +
                                        "如: '@','.', ',', '!'",
                                        "提示");
                        e.Node.BeginEdit();
                    }
                }
                else
                {
                    /* Cancel the label edit action, inform the user, and
                     * place the node in edit mode again. */
                    e.CancelEdit = true;
                    MessageBox.Show("名称不能为空",
                                    "提示");
                    e.Node.BeginEdit();
                }
            }
        }
Пример #25
0
 private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (!start)
     {
         return;
     }
     if (string.IsNullOrEmpty(e.Label))
     {
         e.CancelEdit = false;
     }
     else
     {
         treeView1.LabelEdit = false;
         if (e.Node.Level == 1)
         {
             foreach (DriverMetaData device in devices)
             {
                 if (device.ID.ToString() == e.Node.Name)
                 {
                     device.Name = e.Label;
                     break;
                 }
             }
         }
         else
         {
             if (!groups.Exists(x => x.Name == e.Label))
             {
                 foreach (GroupMeta grp in groups)
                 {
                     if (grp.ID.ToString() == e.Node.Name)
                     {
                         grp.Name = e.Label;
                         break;
                     }
                 }
             }
             else
             {
                 MessageBox.Show("组名不能重复!");
             }
         }
     }
 }
Пример #26
0
        private void tvwKeys_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            tvwKeys.LabelEdit = false;
            string keyName = e.Label == null ? e.Node.Text : e.Label;

            try
            {
                Microsoft.Win32.RegistryKey      readOnlyParent = (Microsoft.Win32.RegistryKey)e.Node.Parent.Tag;
                RegistryExplorer.Registry.RegKey parent         = RegistryExplorer.Registry.RegKey.Parse(readOnlyParent.Name, true);
                parent.Key.CreateSubKey(keyName);
                e.Node.Name = parent.Key.Name + "\\" + keyName;
                e.Node.Tag  = RegistryExplorer.Registry.RegKey.Parse(e.Node.Name).Key;
            }
            catch
            {
                e.Node.Remove();
                UIUtility.DisplayError(this, RegistryExplorer.Properties.Resources.Error_CreateKeyFail);
            }
        }
 protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
 {
     if (string.IsNullOrEmpty(e.Label))
     {
         e.CancelEdit = true;
         return;
     }
     if (e.Node is AlbumNode)
     {
         AlbumNode node = e.Node as AlbumNode;
         e.CancelEdit = !node.RenameAlbum(e.Label);
     }
     else if (e.Node is PhotoNode)
     {
         PhotoNode node = e.Node as PhotoNode;
         node.Photograph.Caption = e.Label;
         SaveAlbumChanges();
     }
 }
        private void OnAfterLabelEdit(Object sender, NodeLabelEditEventArgs e)
        {
            // null still returned if label unmodified (verified 2310)
            if (e.Label == null)
            {
                return;
            }

            String oldLabel = e.Node.Text;
            String newLabel = e.Label;

            bool labelIsLegal = true;

            if (!DeviceFilterEditorDialog.NewLabelIsLegal(
                    _designer.UnderlyingControl.Site,
                    _appliedFiltersList,
                    oldLabel,
                    newLabel,
                    SR.GetString(SR.AppliedDeviceFiltersDialog_Title)
                    ))
            {
                labelIsLegal = false;
            }
            else if (IsDefaultFilter(newLabel))
            {
                GenericUI.ShowWarningMessage(
                    SR.GetString(SR.AppliedDeviceFiltersDialog_Title),
                    SR.GetString(SR.DeviceFilterEditorDialog_IllegalDefaultName)
                    );
                labelIsLegal = false;
            }

            if (!labelIsLegal)
            {
                e.CancelEdit = true;
                return;
            }

            ((ChoiceTreeNode)e.Node).Name = newLabel;
            EnsureDefaultFilterAvailableXorApplied();
            SetDirty(true);
            UpdateUI();
        }
Пример #29
0
        private void treeView_Project_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            //ReName ProjectName
            if (e.Node.ImageIndex == 0)
            {
            }

            //ReName MotionName
            if (e.Node.ImageIndex == 2)
            {
                mNowMotionName = e.Node.Text;
            }

            //ReName ElementsName
            if (e.Node.ImageIndex == 4)
            {
                TimeLine.EditFrame.RenameElements(e.Node.Tag, e.Node.Text);
            }
        }
Пример #30
0
        /// <summary>
        /// 模板名称编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void neuTreeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label != null)
            {
                if (e.Label.Length > 0)
                {
                    if (e.Label.IndexOfAny(new char[] { '@', '.', ',', '!' }) == -1)
                    {
                        e.Node.EndEdit(false);
                    }
                    else
                    {
                        e.CancelEdit = true;
                        MessageBox.Show(Language.Msg("存在无效字符!请重新命名"));
                        e.Node.BeginEdit( );
                    }
                }
                else
                {
                    e.CancelEdit = true;
                    MessageBox.Show(Language.Msg("模板名称不能为空"));
                    e.Node.BeginEdit( );
                }

                if (!this.isNew)
                {
                    this.neuTreeView1.LabelEdit = false;
                    this.currTemplate.Name      = e.Label;
                    for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++)
                    {
                        this.neuSpread1_Sheet1.Cells[i, 1].Text = this.currTemplate.Name;
                    }
                    //更新数据库
                    this.SaveTerminal( );
                }
                else
                {
                    this.currTemplate.ID   = "";
                    this.currTemplate.Name = e.Label;
                    this.isNew             = false;
                }
            }
        }
        private void treeMapList_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (!mCanEdit)
            {
                return;
            }

            if (e.Node != null)
            {
                if (!string.IsNullOrEmpty(e.Label))
                {
                    if (e.Node.Tag.GetType() == typeof(MapListMap))
                    {
                        ((MapListMap)e.Node.Tag).Name = e.Label;

                        //Send Rename Map
                        PacketSender.SendRename((MapListItem)e.Node.Tag, e.Label);
                        e.Node.Text = ((MapListMap)e.Node.Tag).Name;
                    }
                    else
                    {
                        ((MapListFolder)e.Node.Tag).Name = e.Label;

                        //Send Rename Folder
                        PacketSender.SendRename((MapListItem)e.Node.Tag, e.Label);
                        e.Node.Text = e.Label;
                    }
                }
                else
                {
                    if (e.Node.Tag.GetType() == typeof(MapListMap))
                    {
                        e.Node.Text = ((MapListMap)e.Node.Tag).Name;
                    }
                    else
                    {
                        e.Node.Text = e.Label;
                    }
                }
            }

            e.CancelEdit = true;
        }
Пример #32
0
	void TreeView_AfterLabelEdit (object sender, NodeLabelEditEventArgs e)
	{
		if (e.Label == null)
			return;

		switch (e.Label.ToUpper ()) {
		case "MWF":
		case "MONO":
			_treeView.SelectedNode = e.Node;
			break;
		case "REMOVE":
			e.Node.Remove ();
			break;
		case "CANCEL":
			e.CancelEdit = true;
			break;
		default:
			break;
		}
	}
Пример #33
0
	void TreeView_AfterLabelEdit (object sender, NodeLabelEditEventArgs e)
	{
		string newLabel = e.Label == null ? "null" : e.Label;
		_eventsText.AppendText ("TreeView => AfterLabelEdit (" + e.Node.Text +
			" => " + newLabel + ")" + Environment.NewLine);
		e.CancelEdit = _afterCancelCheckBox.Checked;
	}
Пример #34
0
    private void OnProjectTree_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
    {
        if (e.Label != null)
        {
            Rename(e.Node.Name, e.Label);
        }

        string newPath = e.Node.Name.Replace(e.Node.Text, e.Label);

        if (Directory.Exists(newPath))
        {
            UpdateFolderPaths(e.Node, newPath);
        }
    }
Пример #35
0
 private void boundTreeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     var docTypeEdit = _docTypes.FindDocTypeEditByDocTypeID((int) e.Node.Tag);
     docTypeName.Text = docTypeEdit.DocTypeName;
 }