50
50
options.SelectedItem = ((IMethod)options.SelectedItem).DeclaringType;
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);
55
var t = (IType)options.SelectedItem;
56
if (t.Kind == TypeKind.TypeParameter) {
57
this.Title = GettextCatalog.GetString ("Rename Type Parameter");
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;
67
this.renameFileFlag.Active = false;
69
if (typeDefinition.Kind == TypeKind.Interface)
70
this.Title = GettextCatalog.GetString ("Rename Interface");
72
this.Title = GettextCatalog.GetString ("Rename Class");
67
if (type.Kind == TypeKind.Interface)
68
this.Title = GettextCatalog.GetString ("Rename Interface");
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");