- source.zip
- CodeXchange Addin source
- CodeXchangeAddin.sln
- CodeXchangeAddin.suo
- Sand.Services.Codexchange.Client
- API
- Components
- Exceptions
- Interfaces
- bin
- Debug
- Sand.Services.CodeXchange.Client.dll
- Sand.Services.CodeXchange.Client.pdb
- CodeXChangeControl.cs
- CodeXChangeControl.resx
- Controls
- Forms
- Key.snk
- Misc
- obj
- Debug
- DesignTimeResolveAssemblyReferencesInput.cache
- GenerateResource-ResGen.read.1.tlog
- GenerateResource-ResGen.write.1.tlog
- Sand.Services.CodeXchange.Client.CodeXChangeControl.resources
- Sand.Services.CodeXchange.Client.Controls.ExplorerBar.resources
- Sand.Services.CodeXchange.Client.Controls.ExplorerGroup.resources
- Sand.Services.CodeXchange.Client.Controls.SnippetListView.resources
- Sand.Services.CodeXchange.Client.Controls.SourceCodeTextBox.resources
- Sand.Services.CodeXchange.Client.Controls.WhatsNewControl.resources
- Sand.Services.CodeXchange.Client.dll
- Sand.Services.CodeXchange.Client.LoginForm.resources
- Sand.Services.CodeXchange.Client.pdb
- Sand.Services.CodeXchange.Client.PreviewCodeForm.resources
- Sand.Services.CodeXchange.Client.SettingsForm.resources
- Sand.Services.CodeXchange.Client.SnippetAddForm.resources
- Sand.Services.CodeXchange.Client.SnippetCommentsForm.resources
- Sand.Services.CodeXchange.Client.SnippetRating.resources
- Sand.Services.CodeXchange.Client2005.csproj.FileListAbsolute.txt
- TempPE
- Web References.CodeXchangeService.Reference.cs.dll
- Properties
- Providers
- Sand.Services.CodeXchange.Client.csproj
- Sand.Services.CodeXchange.Client2005.csproj
- Sand.Services.CodeXchange.Client2005.csproj.user
- UI
- Combos
- Controls
- Web References
- CodeXchangeService
- CodexchangeService.disco
- CodexchangeService.wsdl
- Comment.datasource
- Comment1.datasource
- Comment2.datasource
- Reference.cs
- Reference.map
- ServiceInfo.datasource
- ServiceInfo1.datasource
- Snippet.datasource
- Snippet1.datasource
- Stats.datasource
- Stats1.datasource
- Sand.Services.CodeXchange.VS2010Addin
- Temp
|
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace Sand.Services.CodeXchange.Client.Controls
{
/// <summary>
/// OptionSectionPanel mimics the option panels of Outlook 2003
/// (Caption text, a line on the right and optional an image left below).
/// </summary>
[DefaultProperty("Text")]
public class OptionSectionPanel : System.Windows.Forms.Panel
{
private Color _highlight = Color.FromKnownColor( KnownColor.ControlLightLight );
private Color _shadow = Color.FromKnownColor( KnownColor.ControlDark );
private Image _image = null;
private Point _imageLocation;
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Initializer.
/// </summary>
public OptionSectionPanel()
{
_imageLocation = new Point(0, 20);
SetStyle(ControlStyles.DoubleBuffer, true);
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
protected override void OnPaintBackground(PaintEventArgs pe)
{
base.OnPaintBackground (pe);
StringFormat sf = new StringFormat (StringFormatFlags.MeasureTrailingSpaces|
StringFormatFlags.NoWrap);
Graphics g = pe.Graphics;
SizeF lt = g.MeasureString(this.Text + " ", this.Font, this.Width, sf);
float lth = lt.Height / 2;
Brush h = new SolidBrush( _highlight );
Pen ph = new Pen(h, 1.0f);
Brush s = new SolidBrush( _shadow );
Pen ps = new Pen(s, 1.0f);
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault;
g.DrawString(this.Text, this.Font, SystemBrushes.FromSystemColor(this.ForeColor) , new PointF(0,0), sf);
g.DrawLine( ps, lt.Width, lth, Width, lth );
g.DrawLine( ph, lt.Width, lth + 1.0f, Width, lth + 1.0f);
if (this._image != null)
g.DrawImage(this._image, _imageLocation.X, _imageLocation.Y, this._image.Width, this._image.Height);
sf.Dispose();
ph.Dispose();
ps.Dispose();
h.Dispose();
s.Dispose();
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// OptionSectionPanel
//
this.Size = new System.Drawing.Size(220, 150);
}
#endregion
/// <summary>
/// Set/Get the image to be displayed for this option
/// </summary>
[
Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
DefaultValue(null),
Category("Appearance")
]
public Image Image
{
get { return this._image; }
set
{
this._image = value;
this.Invalidate();
}
}
/// <summary>
/// Set/Get the section caption text
/// </summary>
[
Browsable(true), Localizable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
DefaultValue(null),
Category("Appearance")
]
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = value;
this.Invalidate();
}
}
/// <summary>
/// Set/Get the Image Location.
/// </summary>
[
Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
Category("Layout")
]
public Point ImageLocation
{
get
{
return _imageLocation;
}
set
{
_imageLocation = value;
this.Invalidate();
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Hi! I'm 22 years old. I live in a sunny mediterranian city called Barcelona.
I am a big fan of .NET and have been working with c# for a few years now.