~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                                options.SelectedItem = ((IMethod)options.SelectedItem).DeclaringType;
51
51
                        }
52
52
                        this.Build ();
53
 
 
54
53
                        if (options.SelectedItem is IType) {
55
 
                                var type = ((IType)options.SelectedItem).GetDefinition ();
56
 
                                if (type.DeclaringType == null) {
57
 
                                        // not supported for inner types
58
 
                                        this.renameFileFlag.Visible = true;
59
 
                                        this.renameFileFlag.Active = true;
60
 
                                        // if more than one type is in the file, only rename the file as defilt if the file name contains the type name
61
 
                                        // see Bug 603938 - Renaming a Class in a file with multiple classes renames the file
62
 
                                        if (options.Document != null && options.Document.ParsedDocument.TopLevelTypeDefinitions.Count > 1) 
63
 
                                                this.renameFileFlag.Active = options.Document.FileName.FileNameWithoutExtension.Contains (type.Name);
 
54
 
 
55
                                var t = (IType)options.SelectedItem;
 
56
                                if (t.Kind == TypeKind.TypeParameter) {
 
57
                                        this.Title = GettextCatalog.GetString ("Rename Type Parameter");
 
58
                                        entry.Text = t.Name;
 
59
 
64
60
                                } else {
65
 
                                        this.renameFileFlag.Active = false;
 
61
                                        var typeDefinition = (t).GetDefinition ();
 
62
                                        if (typeDefinition.DeclaringType == null) {
 
63
                                                // not supported for inner types
 
64
                                                this.renameFileFlag.Visible = true;
 
65
                                                this.renameFileFlag.Active = options.Document != null ? options.Document.FileName.FileNameWithoutExtension.Contains (typeDefinition.Name) : false;
 
66
                                        } else {
 
67
                                                this.renameFileFlag.Active = false;
 
68
                                        }
 
69
                                        if (typeDefinition.Kind == TypeKind.Interface)
 
70
                                                this.Title = GettextCatalog.GetString ("Rename Interface");
 
71
                                        else
 
72
                                                this.Title = GettextCatalog.GetString ("Rename Class");
66
73
                                }
67
 
                                if (type.Kind == TypeKind.Interface)
68
 
                                        this.Title = GettextCatalog.GetString ("Rename Interface");
69
 
                                else
70
 
                                        this.Title = GettextCatalog.GetString ("Rename Class");
71
74
                                //                              this.fileName = type.GetDefinition ().Region.FileName;
72
75
                        } else if (options.SelectedItem is IField) {
73
76
                                this.Title = GettextCatalog.GetString ("Rename Field");