- ietoolbarenginesources.zip
- IEToolbarEngine
- IEToolbarInstallation
- IEToolbarInstallation.vdproj
- SetupFiles
- IEToolbarInstallation.msi
- setup.exe
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Xml;
namespace IEToolbarEngine
{
internal class LinkItem: BaseToolbarItem
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="engine">Toolbar engine</param>
internal LinkItem (IEToolbarEngine engine, string caption, string hint, string url, System.Drawing.Image img)
: base (engine, img)
{
Create(caption, hint, url);
}
public override ToolbarItemType TypeID
{
get { return ToolbarItemType.Link; }
}
public void Create (string buttonText,
string buttonTooltip,
string targetURL)
{
this.targetURL = targetURL;
this.linkButton = new System.Windows.Forms.ToolStripButton ();
this.linkButton.Image = this.Image;
this.linkButton.ImageAlign = ContentAlignment.MiddleLeft;
this.linkButton.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.linkButton.Text = buttonText;
this.linkButton.ToolTipText = buttonTooltip;
this.linkButton.Click += new EventHandler(linkButton_Click);
items.Add (this.linkButton);
engine.Toolbar.Items.AddRange (this.items.ToArray ());
}
void linkButton_Click(object sender, EventArgs e)
{
engine.SmartNavigate (this.targetURL);
}
//public override bool RestoreGuts (System.Xml.XmlElement element)
//{
// Reset ();
// try
// {
// base.RestoreGuts (element);
// ReadImage (element);
// string caption = ReadString (element, "caption");
// string hint = ReadString (element, "hint");
// string url = ReadTag (element, "url");
// this.Create (caption, hint, url);
// return true;
// }
// catch (Exception)
// {
// }
// return false;
//}
private System.Windows.Forms.ToolStripButton linkButton;
private string targetURL;
}
}
|
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.
Alexandr Golovanov is a .NET developer at
KB_Soft Group, an offshore software development company located in Russia, Novosibirsk. Here he has worked
on various .NET projects.