コード例 #1
0
        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();
            }
        }
コード例 #2
0
ファイル: DRenameNameDialog.cs プロジェクト: lenoil98/Mono-D
 bool ValidateName()
 {
     return(originalName != text_NewId.Text &&
            DRenameRefactoring.IsValidIdentifier(text_NewId.Text));
 }
コード例 #3
0
 bool ValidateName()
 {
     return(DRenameRefactoring.IsValidIdentifier(text_NewId.Text));
 }