void nameCell_Edited(object o, EditedArgs args) { TreeIter iter; TreeStore.GetIter(out iter, new Gtk.TreePath(args.Path)); var n = TreeStore.GetValue(iter, 0) as INode; if (n != null && args.NewText != n.Name && DRenameRefactoring.CanRenameNode(n) && DRenameRefactoring.IsValidIdentifier(args.NewText)) { RefactoringService.AcceptChanges( IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor("Rename item", null), new DRenameRefactoring().PerformChanges( new RefactoringOptions(IdeApp.Workbench.ActiveDocument) { SelectedItem = n }, new MonoDevelop.Refactoring.Rename.RenameRefactoring.RenameProperties { NewName = args.NewText })); TreeView.Selection.SelectIter(iter); TreeView.GrabFocus(); } }
bool ValidateName() { return(originalName != text_NewId.Text && DRenameRefactoring.IsValidIdentifier(text_NewId.Text)); }
bool ValidateName() { return(DRenameRefactoring.IsValidIdentifier(text_NewId.Text)); }