Browse Source

Fixed SD2-904 by displaying an error message if a class contains multiple InitializeComponents methods.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1644 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
b4f80867cd
  1. 3
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/NRefactoryDesignerLoader.cs
  2. 1
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

3
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/NRefactoryDesignerLoader.cs

@ -274,6 +274,9 @@ namespace ICSharpCode.FormsDesigner @@ -274,6 +274,9 @@ namespace ICSharpCode.FormsDesigner
// remove all methods except InitializeComponents
if ((method.Name == "InitializeComponents" || method.Name == "InitializeComponent") && method.Parameters.Count == 0) {
method.Name = "InitializeComponent";
if (foundInitMethod) {
throw new FormsDesignerLoadException("There are multiple InitializeComponent methods in the class. Designer cannot be loaded.");
}
foundInitMethod = true;
} else {
typeDecl.Children.RemoveAt(i--);

1
src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

@ -164,6 +164,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -164,6 +164,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
{
base.OnFileNameChanged(e);
textAreaControl.FileName = base.FileName;
SetWatcher(); // update file name the watcher looks at
}
public void Undo()

Loading…
Cancel
Save