Browse Source

Implemented forum-10323: TODO comments in designer-generated event handlers

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1732 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
b2a1463b3b
  1. 5
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerGenerator.cs
  2. 36
      src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGeneralOptions.xfrm
  3. 5
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs
  4. 5
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs
  5. 11
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs

5
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/Designer/BooDesignerGenerator.cs

@ -114,6 +114,11 @@ namespace Grunwald.BooBinding.Designer @@ -114,6 +114,11 @@ namespace Grunwald.BooBinding.Designer
StringBuilder b = new StringBuilder();
b.AppendLine(indentation);
b.AppendLine(indentation + "private def " + eventMethodName + "(" + param + "):");
if (string.IsNullOrEmpty(body)) {
if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel.InsertTodoComment) {
body = "// TODO: Implement " + eventMethodName;
}
}
b.AppendLine(indentation + "\t" + body);
return b.ToString();
}

36
src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGeneralOptions.xfrm

@ -5,60 +5,68 @@ @@ -5,60 +5,68 @@
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="propertyPadOptionsGroupBox" />
<Location value="{X=9,Y=168}" />
<Location value="8, 180" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PropertyGridGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=372, Height=56}" />
<Size value="373, 56" />
<TabIndex value="1" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="sortAlphabeticalCheckBox" />
<Location value="{X=6,Y=24}" />
<Location value="6, 24" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PropertyGridSortCheckBox}" />
<TabIndex value="0" />
<Size value="{Width=366, Height=24}" />
<Size value="366, 24" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="generalOptionsGroupBox" />
<Location value="{X=8,Y=8}" />
<Location value="8, 8" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.GeneralOptionsGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=373, Height=145}" />
<Size value="373, 166" />
<TabIndex value="0" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="insertTodoCommentCheckBox" />
<Location value="6, 136" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.InsertTodoCommentInEventHandlers}" />
<TabIndex value="3" />
<Size value="367, 24" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="optimizedCodeGenerationCheckBox" />
<Location value="{X=6,Y=110}" />
<Location value="6, 110" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.OptimizedCodeGenerationCheckBox}" />
<TabIndex value="3" />
<Size value="{Width=367, Height=24}" />
<Size value="367, 24" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="smartTagAutoShowCheckBox" />
<Location value="{X=6,Y=80}" />
<Location value="6, 80" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SmartTagAutoShowCheckBox}" />
<TabIndex value="2" />
<Size value="{Width=367, Height=24}" />
<Size value="367, 24" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="inPlaceEditCheckBox" />
<Location value="{X=6,Y=50}" />
<Location value="6, 50" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.InPlaceEditCheckBox}" />
<TabIndex value="1" />
<Size value="{Width=367, Height=24}" />
<Size value="367, 24" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="useSmartTagsCheckBox" />
<Location value="{X=6,Y=20}" />
<Location value="6, 20" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SmartTagsCheckBox}" />
<TabIndex value="0" />
<Size value="{Width=367, Height=24}" />
<Size value="367, 24" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
</Controls>

5
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/CSharpDesignerGenerator.cs

@ -35,6 +35,11 @@ namespace ICSharpCode.FormsDesigner @@ -35,6 +35,11 @@ namespace ICSharpCode.FormsDesigner
b.AppendLine(indentation);
b.AppendLine(indentation + "void " + eventMethodName + "(" + param + ")");
b.AppendLine(indentation + "{");
if (string.IsNullOrEmpty(body)) {
if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel.InsertTodoComment) {
body = "// TODO: Implement " + eventMethodName;
}
}
b.AppendLine(indentation + "\t" + body);
b.AppendLine(indentation + "}");
return b.ToString();

5
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerGenerator/VBNetDesignerGenerator.cs

@ -34,6 +34,11 @@ namespace ICSharpCode.FormsDesigner @@ -34,6 +34,11 @@ namespace ICSharpCode.FormsDesigner
StringBuilder b = new StringBuilder();
b.AppendLine(indentation);
b.AppendLine(indentation + "Sub " + eventMethodName + "(" + param + ")");
if (string.IsNullOrEmpty(body)) {
if (ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel.InsertTodoComment) {
body = "' TODO: Implement " + eventMethodName;
}
}
b.AppendLine(indentation + "\t" + body);
b.AppendLine(indentation + "End Sub");
return b.ToString();

11
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs

@ -29,6 +29,16 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels @@ -29,6 +29,16 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true);
((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true);
((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", true);
((CheckBox)ControlDictionary["insertTodoCommentCheckBox"]).Checked = InsertTodoComment;
}
public static bool InsertTodoComment {
get {
return PropertyService.Get("FormsDesigner.DesignerOptions.InsertTodoComment", false);
}
set {
PropertyService.Set("FormsDesigner.DesignerOptions.InsertTodoComment", value);
}
}
public override bool StorePanelContents()
@ -38,6 +48,7 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels @@ -38,6 +48,7 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
PropertyService.Set("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", ((CheckBox)ControlDictionary["smartTagAutoShowCheckBox"]).Checked);
PropertyService.Set("FormsDesigner.DesignerOptions.EnableInSituEditing", ((CheckBox)ControlDictionary["inPlaceEditCheckBox"]).Checked);
PropertyService.Set("FormsDesigner.DesignerOptions.UseSmartTags", ((CheckBox)ControlDictionary["useSmartTagsCheckBox"]).Checked);
InsertTodoComment = ((CheckBox)ControlDictionary["insertTodoCommentCheckBox"]).Checked;
return true;
}

Loading…
Cancel
Save