Browse Source

Added Alex Knip's patch to fix SD2-553 - Cannot Show Form Designer Grid.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1231 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 20 years ago
parent
commit
d80ad0eb28
  1. BIN
      data/resources/StringResources.cz.resources
  2. BIN
      data/resources/StringResources.de.resources
  3. BIN
      data/resources/StringResources.es-mx.resources
  4. BIN
      data/resources/StringResources.hu.resources
  5. BIN
      data/resources/StringResources.it.resources
  6. BIN
      data/resources/StringResources.nl.resources
  7. BIN
      data/resources/StringResources.ro.resources
  8. BIN
      data/resources/StringResources.se.resources
  9. 3
      src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin
  10. 2
      src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj
  11. 68
      src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGeneralOptions.xfrm
  12. 87
      src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm
  13. 2
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs
  14. 46
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GeneralOptions.cs
  15. 39
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs
  16. 149
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs
  17. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

BIN
data/resources/StringResources.cz.resources

Binary file not shown.

BIN
data/resources/StringResources.de.resources

Binary file not shown.

BIN
data/resources/StringResources.es-mx.resources

Binary file not shown.

BIN
data/resources/StringResources.hu.resources

Binary file not shown.

BIN
data/resources/StringResources.it.resources

Binary file not shown.

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

BIN
data/resources/StringResources.ro.resources

Binary file not shown.

BIN
data/resources/StringResources.se.resources

Binary file not shown.

3
src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.addin

@ -303,6 +303,9 @@ @@ -303,6 +303,9 @@
insertafter = "ToolsOptions"
label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.PanelName}">
<DialogPanel id = "GeneralOptions"
label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GeneralOptionsPanel.PanelName}"
class = "ICSharpCode.FormsDesigner.Gui.OptionPanels.GeneralOptionsPanel"/>
<DialogPanel id = "GridOptions"
label = "${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PanelName}"
class = "ICSharpCode.FormsDesigner.Gui.OptionPanels.GridOptionsPanel"/>

2
src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesigner.csproj

@ -99,6 +99,8 @@ @@ -99,6 +99,8 @@
<Compile Include="Src\DesignerGenerator\AbstractDesignerGenerator.cs" />
<Compile Include="Src\Services\TypeDiscoveryService.cs" />
<Compile Include="Src\UndoRedo\UndoEngine.cs" />
<Compile Include="Src\Gui\OptionPanels\GeneralOptions.cs" />
<EmbeddedResource Include="Resources\WindowsFormsGeneralOptions.xfrm" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj">

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

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="WindowsFormsGeneralOptions" />
<ClientSize value="{Width=391, Height=300}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="propertyPadOptionsGroupBox" />
<Location value="{X=9,Y=168}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PropertyGridGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=372, Height=56}" />
<TabIndex value="1" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="sortAlphabeticalCheckBox" />
<Location value="{X=6,Y=24}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PropertyGridSortCheckBox}" />
<TabIndex value="0" />
<Size value="{Width=366, Height=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}" />
<Text value="${res:Dialog.Options.IDEOptions.TextEditor.General.GeneralOptionsGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=373, Height=145}" />
<TabIndex value="0" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="optimizedCodeGenerationCheckBox" />
<Location value="{X=6,Y=110}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.OptimizedCodeGenerationCheckBox}" />
<TabIndex value="3" />
<Size value="{Width=367, Height=24}" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="smartTagAutoShowCheckBox" />
<Location value="{X=6,Y=80}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SmartTagAutoShowCheckBox}" />
<TabIndex value="2" />
<Size value="{Width=367, Height=24}" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="inPlaceEditCheckBox" />
<Location value="{X=6,Y=50}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.InPlaceEditCheckBox}" />
<TabIndex value="1" />
<Size value="{Width=367, Height=24}" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="useSmartTagsCheckBox" />
<Location value="{X=6,Y=20}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SmartTagsCheckBox}" />
<TabIndex value="0" />
<Size value="{Width=367, Height=24}" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

87
src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/WindowsFormsGridOptions.xfrm

@ -1,83 +1,84 @@ @@ -1,83 +1,84 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="CreatedUserControl" />
<DockPadding value="" />
<ClientSize value="{Width=224, Height=224}" />
<ClientSize value="{Width=375, Height=357}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="groupBox2" />
<TabIndex value="1" />
<Location value="{X=8,Y=144}" />
<Anchor value="Top, Left, Right" />
<ClientSize value="{Width=208, Height=64}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PropertyGridGroupBox}" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="sortAlphabeticalCheckBox" />
<Location value="{X=8,Y=24}" />
<ClientSize value="{Width=192, Height=24}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.PropertyGridSortCheckBox}" />
<Anchor value="Top, Left, Right" />
<TabIndex value="4" />
</System.Windows.Forms.CheckBox>
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox" />
<TabIndex value="0" />
<Location value="{X=8,Y=8}" />
<Anchor value="Top, Left, Right" />
<ClientSize value="{Width=208, Height=128}" />
<Location value="{X=8,Y=111}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.GridPropertiesGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=367, Height=144}" />
<TabIndex value="1" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="snapToGridCheckBox" />
<Location value="{X=8,Y=96}" />
<ClientSize value="{Width=192, Height=24}" />
<Location value="{X=8,Y=111}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapToGridComboBox}" />
<Anchor value="Bottom, Left, Right" />
<TabIndex value="5" />
<Size value="{Width=343, Height=24}" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="showGridCheckBox" />
<Location value="{X=8,Y=72}" />
<ClientSize value="{Width=192, Height=24}" />
<Location value="{X=8,Y=84}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.ShowGridComboBox}" />
<Anchor value="Bottom, Left, Right" />
<TabIndex value="4" />
<Size value="{Width=343, Height=24}" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.TextBox>
<Name value="heightTextBox" />
<TabIndex value="3" />
<Location value="{X=104,Y=40}" />
<ClientSize value="{Width=68, Height=17}" />
<Text value="" />
<Size value="{Width=53, Height=21}" />
<Location value="{X=133,Y=51}" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label" />
<Name value="gridHeightLabel" />
<Location value="{X=8,Y=51}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.HeightLabel}" />
<TextAlign value="MiddleRight" />
<Size value="{Width=121, Height=23}" />
<TabIndex value="2" />
<ClientSize value="{Width=88, Height=23}" />
<Location value="{X=8,Y=40}" />
</System.Windows.Forms.Label>
<System.Windows.Forms.TextBox>
<Name value="widthTextBox" />
<TabIndex value="1" />
<Location value="{X=104,Y=16}" />
<ClientSize value="{Width=68, Height=17}" />
<Text value="" />
<Size value="{Width=53, Height=21}" />
<Location value="{X=133,Y=20}" />
</System.Windows.Forms.TextBox>
<System.Windows.Forms.Label>
<Name value="label" />
<Name value="gridWidthLabel" />
<Location value="{X=6,Y=20}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.WidthLabel}" />
<TextAlign value="MiddleRight" />
<Size value="{Width=121, Height=23}" />
<TabIndex value="0" />
<ClientSize value="{Width=88, Height=23}" />
<Location value="{X=8,Y=16}" />
</System.Windows.Forms.Label>
</Controls>
</System.Windows.Forms.GroupBox>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Location value="{X=8,Y=8}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapModeGroupBox}" />
<Anchor value="Top, Left, Right" />
<Size value="{Width=367, Height=87}" />
<TabIndex value="0" />
<Controls>
<System.Windows.Forms.RadioButton>
<Name value="snapToGridRadioButton" />
<Location value="{X=8,Y=20}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapToGridRadioButton}" />
<Size value="{Width=353, Height=24}" />
<TabIndex value="0" />
</System.Windows.Forms.RadioButton>
<System.Windows.Forms.RadioButton>
<Name value="snapLinesRadioButton" />
<Location value="{X=8,Y=50}" />
<Text value="${res:ICSharpCode.SharpDevelop.FormDesigner.Gui.OptionPanels.GridOptionsPanel.SnapLinesRadioButton}" />
<Size value="{Width=353, Height=24}" />
<TabIndex value="1" />
</System.Windows.Forms.RadioButton>
</Controls>
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>
</Components>

2
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs

@ -140,7 +140,7 @@ namespace ICSharpCode.FormsDesigner @@ -140,7 +140,7 @@ namespace ICSharpCode.FormsDesigner
serviceContainer.AddService(typeof(AmbientProperties), ambientProperties);
serviceContainer.AddService(typeof(ITypeResolutionService), new TypeResolutionService(viewContent.FileName));
serviceContainer.AddService(typeof(System.ComponentModel.Design.IDesignerEventService), new DesignerEventService());
serviceContainer.AddService(typeof(System.ComponentModel.Design.DesignerOptionService), new ICSharpCode.FormsDesigner.Services.DesignerOptionService());
serviceContainer.AddService(typeof(DesignerOptionService), new SharpDevelopDesignerOptionService());
serviceContainer.AddService(typeof(ITypeDiscoveryService), new TypeDiscoveryService());
serviceContainer.AddService(typeof(MemberRelationshipService), new DefaultMemberRelationshipService());

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

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
{
public class GeneralOptionsPanel : AbstractOptionPanel
{
public override void LoadPanelContents()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.FormsDesigner.Resources.WindowsFormsGeneralOptions.xfrm"));
((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", false);
((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true);
((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);
}
public override bool StorePanelContents()
{
PropertyService.Set("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked);
PropertyService.Set("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", ((CheckBox)ControlDictionary["optimizedCodeGenerationCheckBox"]).Checked);
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);
return true;
}
}
}

39
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/OptionPanels/GridOptions.cs

@ -16,7 +16,6 @@ using ICSharpCode.Core; @@ -16,7 +16,6 @@ using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
{
public class GridOptionsPanel : AbstractOptionPanel
@ -25,11 +24,17 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels @@ -25,11 +24,17 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.FormsDesigner.Resources.WindowsFormsGridOptions.xfrm"));
ControlDictionary["widthTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8).ToString();
ControlDictionary["heightTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8).ToString();
((CheckBox)ControlDictionary["showGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true);
((CheckBox)ControlDictionary["snapToGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true);
((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", false);
bool snapToGridOn = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGridMode", false);
((RadioButton)ControlDictionary["snapToGridRadioButton"]).Checked = snapToGridOn;
((RadioButton)ControlDictionary["snapLinesRadioButton"]).Checked = !snapToGridOn;
ControlDictionary["widthTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8).ToString();
ControlDictionary["heightTextBox"].Text = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8).ToString();
((CheckBox)ControlDictionary["showGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true);
((CheckBox)ControlDictionary["snapToGridCheckBox"]).Checked = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true);
((RadioButton)ControlDictionary["snapToGridRadioButton"]).CheckedChanged += SnapToGridChanged;
EnableGridOptions(snapToGridOn);
}
public override bool StorePanelContents()
@ -38,7 +43,7 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels @@ -38,7 +43,7 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
try {
width = Int32.Parse(ControlDictionary["widthTextBox"].Text);
} catch {
MessageService.ShowError("Forms Designer grid with is invalid");
MessageService.ShowError("Forms Designer grid width is invalid");
return false;
}
@ -46,17 +51,31 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels @@ -46,17 +51,31 @@ namespace ICSharpCode.FormsDesigner.Gui.OptionPanels
try {
height = Int32.Parse(ControlDictionary["heightTextBox"].Text);
} catch {
MessageService.ShowError("Forms Designer height with is invalid");
MessageService.ShowError("Forms Designer grid height is invalid");
return false;
}
PropertyService.Set("FormsDesigner.DesignerOptions.SnapToGridMode", ((RadioButton)ControlDictionary["snapToGridRadioButton"]).Checked);
PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeWidth", width);
PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeHeight", height);
PropertyService.Set("FormsDesigner.DesignerOptions.UseSnapLines", ((RadioButton)ControlDictionary["snapLinesRadioButton"]).Checked);
PropertyService.Set("FormsDesigner.DesignerOptions.ShowGrid", ((CheckBox)ControlDictionary["showGridCheckBox"]).Checked);
PropertyService.Set("FormsDesigner.DesignerOptions.SnapToGrid", ((CheckBox)ControlDictionary["snapToGridCheckBox"]).Checked);
PropertyService.Set("FormsDesigner.DesignerOptions.PropertyGridSortAlphabetical", ((CheckBox)ControlDictionary["sortAlphabeticalCheckBox"]).Checked);
return true;
}
void EnableGridOptions(bool snapToGridOn)
{
ControlDictionary["widthTextBox"].Enabled = snapToGridOn;
ControlDictionary["heightTextBox"].Enabled = snapToGridOn;
((CheckBox)ControlDictionary["showGridCheckBox"]).Enabled = snapToGridOn;
((CheckBox)ControlDictionary["snapToGridCheckBox"]).Enabled = snapToGridOn;
}
void SnapToGridChanged(object source, EventArgs e)
{
EnableGridOptions(((RadioButton)ControlDictionary["snapToGridRadioButton"]).Checked);
}
}
}

149
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/DesignerOptionService.cs

@ -16,61 +16,116 @@ namespace ICSharpCode.FormsDesigner.Services @@ -16,61 +16,116 @@ namespace ICSharpCode.FormsDesigner.Services
{
public class SharpDevelopDesignerOptions : DesignerOptions
{
bool enableInSituEditing;
bool objectBoundSmartTagAutoShow;
bool useOptimizedCodeGeneration;
Size gridSize = Size.Empty;
bool showGrid;
bool snapToGrid;
bool useSnapLines;
bool useSmartTags;
public SharpDevelopDesignerOptions()
{
UseSmartTags = true;
UseSnapLines = true;
int w = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8);
int h = PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8);
this.gridSize = new Size(w, h);
this.showGrid = PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true);
this.snapToGrid = PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true);
this.useSmartTags = PropertyService.Get("FormsDesigner.DesignerOptions.UseSmartTags", false);
this.useSnapLines = PropertyService.Get("FormsDesigner.DesignerOptions.UseSnapLines", true);
this.enableInSituEditing = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true);
this.objectBoundSmartTagAutoShow = PropertyService.Get("FormsDesigner.DesignerOptions.ObjectBoundSmartTagAutoShow", true);
this.useOptimizedCodeGeneration = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true);
}
// Obtains and shows the size of the standard design-mode grid square.
public override Size GridSize {
get {
return gridSize;
}
}
// Obtains and shows whether the design mode surface grid is enabled.
public override bool ShowGrid {
get {
return showGrid;
}
}
// Obtains and shows whether components should be aligned with the surface grid.
public override bool SnapToGrid {
get {
return snapToGrid;
}
}
// public override Size GridSize {
// get {
// return new Size(PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeWidth", 8),
// PropertyService.Get("FormsDesigner.DesignerOptions.GridSizeHeight", 8));
// }
// set {
// LoggingService.Debug("GridSize set");
// PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeWidth", value.Width);
// PropertyService.Set("FormsDesigner.DesignerOptions.GridSizeHeight", value.Height);
// }
// }
//
// public override bool ShowGrid {
// get {
// LoggingService.Debug("ShowGrid get");
// return PropertyService.Get("FormsDesigner.DesignerOptions.ShowGrid", true);
// }
// set {
// LoggingService.Debug("ShowGrid set");
// PropertyService.Set("FormsDesigner.DesignerOptions.ShowGrid", value);
// }
// }
//
// public override bool SnapToGrid {
// get {
// LoggingService.Debug("SnapToGrid get");
// return PropertyService.Get("FormsDesigner.DesignerOptions.SnapToGrid", true);
// }
// set {
// LoggingService.Debug("SnapToGrid set");
// }
// }
// Gets or sets a value that enables or disables smart tags in the designer.
public override bool UseSmartTags {
get {
return useSmartTags;
}
}
// Gets or sets a value that enables or disables snaplines in the designer.
public override bool UseSnapLines {
get {
return useSnapLines;
}
}
// Gets or sets a value that enables or disables in-place editing for ToolStrip controls.
public override bool EnableInSituEditing {
get {
return enableInSituEditing;
}
}
// Obtains and shows whether smart tags are automatically opened.
public override bool ObjectBoundSmartTagAutoShow {
get {
return objectBoundSmartTagAutoShow;
}
}
// The component cache is a performance enhancement that is incompatible with certain designers.
// You can disable it with this property
public override bool UseOptimizedCodeGeneration {
get {
return useOptimizedCodeGeneration;
}
}
}
public class DesignerOptionService : WindowsFormsDesignerOptionService
public class SharpDevelopDesignerOptionService : WindowsFormsDesignerOptionService
{
DesignerOptions options;
public DesignerOptionService()
public SharpDevelopDesignerOptionService()
{
ApplySharpDevelopSettings();
}
public override DesignerOptions CompatibilityOptions {
get {
if (options == null) {
options = new SharpDevelopDesignerOptions();
}
return options;
}
void ApplySharpDevelopSettings()
{
SharpDevelopDesignerOptions options = new SharpDevelopDesignerOptions();
this.Options.Properties.Find("GridSize", true).SetValue(this, options.GridSize);
this.Options.Properties.Find("EnableInSituEditing", true).SetValue(this, options.EnableInSituEditing);
this.Options.Properties.Find("ObjectBoundSmartTagAutoShow", true).SetValue(this, options.ObjectBoundSmartTagAutoShow);
this.Options.Properties.Find("UseOptimizedCodeGeneration", true).SetValue(this, options.UseOptimizedCodeGeneration);
this.Options.Properties.Find("UseSmartTags", true).SetValue(this, options.UseSmartTags);
this.Options.Properties.Find("UseSnapLines", true).SetValue(this, options.UseSnapLines);
if (options.UseSnapLines) {
this.Options.Properties.Find("ShowGrid", true).SetValue(this, false);
this.Options.Properties.Find("SnapToGrid", true).SetValue(this, false);
} else {
this.Options.Properties.Find("ShowGrid", true).SetValue(this, options.ShowGrid);
this.Options.Properties.Find("SnapToGrid", true).SetValue(this, options.SnapToGrid);
}
}
}
}

BIN
src/Main/StartUp/Project/Resources/StringResources.resources

Binary file not shown.
Loading…
Cancel
Save