Browse Source

Remove abstract/sealed modifiers from interface when extracting an interface from a class.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3772 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
d8ff8210c5
  1. 2
      src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs
  2. 2
      src/Main/Core/Project/Src/Services/MessageService/IMessageService.cs
  3. 2
      src/Main/Core/Project/Src/Services/MessageService/MessageService.cs
  4. 4
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs

2
src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs

@ -54,7 +54,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring
1, 1,
"${res:Global.ReplaceButtonText}", "${res:Global.ReplaceButtonText}",
"${res:Global.AbortButtonText}"); "${res:Global.AbortButtonText}");
if (confirmReplace == 1) { if (confirmReplace != 0) {
return; return;
} }
} }

2
src/Main/Core/Project/Src/Services/MessageService/IMessageService.cs

@ -48,7 +48,7 @@ namespace ICSharpCode.Core.Services
/// Use -1 if you don't want to have a cancel button. /// Use -1 if you don't want to have a cancel button.
/// </param> /// </param>
/// <param name="buttontexts">The captions of the buttons.</param> /// <param name="buttontexts">The captions of the buttons.</param>
/// <returns>The number of the button that was clicked.</returns> /// <returns>The number of the button that was clicked, or -1 if the dialog was closed without clicking a button.</returns>
int ShowCustomDialog(string caption, string dialogText, int acceptButtonIndex, int cancelButtonIndex, params string[] buttontexts); int ShowCustomDialog(string caption, string dialogText, int acceptButtonIndex, int cancelButtonIndex, params string[] buttontexts);
string ShowInputBox(string caption, string dialogText, string defaultValue); string ShowInputBox(string caption, string dialogText, string defaultValue);
void ShowMessage(string message, string caption); void ShowMessage(string message, string caption);

2
src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

@ -142,7 +142,7 @@ namespace ICSharpCode.Core
/// Use -1 if you don't want to have a cancel button. /// Use -1 if you don't want to have a cancel button.
/// </param> /// </param>
/// <param name="buttontexts">The captions of the buttons.</param> /// <param name="buttontexts">The captions of the buttons.</param>
/// <returns>The number of the button that was clicked.</returns> /// <returns>The number of the button that was clicked, or -1 if the dialog was closed without clicking a button.</returns>
public static int ShowCustomDialog(string caption, string dialogText, int acceptButtonIndex, int cancelButtonIndex, params string[] buttontexts) public static int ShowCustomDialog(string caption, string dialogText, int acceptButtonIndex, int cancelButtonIndex, params string[] buttontexts)
{ {
return ServiceManager.MessageService.ShowCustomDialog(caption, dialogText, acceptButtonIndex, cancelButtonIndex, buttontexts); return ServiceManager.MessageService.ShowCustomDialog(caption, dialogText, acceptButtonIndex, cancelButtonIndex, buttontexts);

4
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs

@ -96,6 +96,10 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
public override string GenerateInterfaceForClass(string newInterfaceName, string existingCode, IList<IMember> membersToKeep, IClass sourceClass, bool preserveComments) public override string GenerateInterfaceForClass(string newInterfaceName, string existingCode, IList<IMember> membersToKeep, IClass sourceClass, bool preserveComments)
{ {
Modifiers modifiers = CodeGenerator.ConvertModifier(sourceClass.Modifiers, new ClassFinder(membersToKeep[0])); Modifiers modifiers = CodeGenerator.ConvertModifier(sourceClass.Modifiers, new ClassFinder(membersToKeep[0]));
// keep only visibility modifiers and 'unsafe' modifier
// -> remove abstract,sealed,static
modifiers &= Modifiers.Visibility | Modifiers.Unsafe;
TypeDeclaration interfaceDef = new TypeDeclaration(modifiers, new List<AttributeSection>()); TypeDeclaration interfaceDef = new TypeDeclaration(modifiers, new List<AttributeSection>());
interfaceDef.Name = newInterfaceName; interfaceDef.Name = newInterfaceName;
interfaceDef.Type = NR.Ast.ClassType.Interface; interfaceDef.Type = NR.Ast.ClassType.Interface;

Loading…
Cancel
Save