Skip to content

Commit

Permalink
Very Important Bug Fix
Browse files Browse the repository at this point in the history
I did not expect the designer creating custom code for every property I
tried to set manually in the code according to the systems theme. This
was a huge problem because the control kept using the same style
information as on the developer's system. To prevent that, I had to
disable the designer serialization for certain control properties. That
also means that you can't set those properties manually in the designer
but I think you can live without that feature until I have found a
solution to this problem, too.
  • Loading branch information
stefan-baumann committed Mar 12, 2015
1 parent 3ad0f51 commit 79e3409
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 0 deletions.
87 changes: 87 additions & 0 deletions AeroSuite/Controls/AeroLinkLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,93 @@ public AeroLinkLabel()



/// <summary>
/// Gets or sets the color used to display links in normal cases.
/// </summary>
/// <value>
/// The color used to display links in normal cases.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color LinkColor
{
get { return base.LinkColor; }
set { base.LinkColor = value; }
}

/// <summary>
/// Gets or sets the color used to display active links.
/// </summary>
/// <value>
/// The color used to display active links.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color ActiveLinkColor
{
get { return base.ActiveLinkColor; }
set { base.ActiveLinkColor = value; }
}

/// <summary>
/// Gets or sets the color used to display disabled links.
/// </summary>
/// <value>
/// The color used to display disabled links.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color DisabledLinkColor
{
get { return base.DisabledLinkColor; }
set { base.DisabledLinkColor = value; }
}

/// <summary>
/// Gets or sets the color used to display the link once it has been visited.
/// </summary>
/// <value>
/// The color used to display the link once it has been visited..
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color VisitedLinkColor
{
get { return base.VisitedLinkColor; }
set { base.VisitedLinkColor = value; }
}

/// <summary>
/// Gets or sets a value that represents how the link will be underlined.
/// </summary>
/// <value>
/// A value that represents how the link will be underlined.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new LinkBehavior LinkBehavior
{
get { return base.LinkBehavior; }
set { base.LinkBehavior = value; }
}



/// <summary>
/// Raises the <see cref="E:MouseDown" /> event.
/// </summary>
Expand Down
17 changes: 17 additions & 0 deletions AeroSuite/Controls/AeroProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ public ProgressBarState State
}
}

/// <summary>
/// The foreground color of the progress bar. Represents the bar color on Windows XP with classic theming and Linux.
/// </summary>
/// <value>
/// The foreground color of the progress bar.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color ForeColor
{
get { return base.ForeColor; }
set { base.ForeColor = value; }
}

/// <summary>
/// Updates the state.
/// </summary>
Expand Down
36 changes: 36 additions & 0 deletions AeroSuite/Controls/AeroTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,42 @@ public AeroTreeView()



/// <summary>
/// The value of the HotTracking property. The HotTracking property determines if nodes are highlighted as the mousepointer passes over them.
/// </summary>
/// <value>
/// A value that determines if nodes are highlighted as the mousepointer passes over them.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Behaviour")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new bool HotTracking
{
get { return base.HotTracking; }
set { base.HotTracking = value; }
}

/// <summary>
/// The ShowLines property determines if lines are drawn between nodes in the tree view.
/// </summary>
/// <value>
/// A value that determines if lines are drawn between nodes in the tree view.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Behaviour")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new bool ShowLines
{
get { return base.ShowLines; }
set { base.ShowLines = value; }
}



/// <summary>
/// Raises the <see cref="E:HandleCreated" /> event.
/// </summary>
Expand Down
34 changes: 34 additions & 0 deletions AeroSuite/Controls/CaptionLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,39 @@ public CaptionLabel()
else
this.ForeColor = SystemColors.Highlight;
}

/// <summary>
/// The foreground color of the control.
/// </summary>
/// <value>
/// The foreground color of the control.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color ForeColor
{
get { return base.ForeColor; }
set { base.ForeColor = value; }
}

/// <summary>
/// Retrieves the current font for this control. This will be the font used by default for painting and text in the control.
/// </summary>
/// <value>
/// The current font for this control.
/// </value>
/// <remarks>
/// This property had to be overriden to prevent the designer creating code for it and so disabling the automatic style adaption.
/// </remarks>
[Category("Appearance")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Font Font
{
get { return base.Font; }
set { base.Font = value; }
}
}
}

0 comments on commit 79e3409

Please sign in to comment.