本文整理汇总了C#中System.Web.UI.Design.ColorBuilder类的典型用法代码示例。如果您正苦于以下问题:C# ColorBuilder类的具体用法?C# ColorBuilder怎么用?C# ColorBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColorBuilder类属于System.Web.UI.Design命名空间,在下文中一共展示了ColorBuilder类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
// Create a parent control.
System.Windows.Forms.Control c = new System.Windows.Forms.Control();
c.CreateControl();
// Launch the Color Builder using the specified control
// parent and an initial HTML format ("RRGGBB") color string.
System.Web.UI.Design.ColorBuilder.BuildColor(this.Component, c, "405599");
示例2: ColorBuilderDesigner
// Example designer provides a designer verb menu command to launch the
// BuildColor method of the ColorBuilder.
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name="FullTrust")]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
public class ColorBuilderDesigner : System.Web.UI.Design.UserControlDesigner
{
public ColorBuilderDesigner()
{
}
// Provides a designer verb menu command for invoking the BuildColor
// method of the ColorBuilder.
public override System.ComponentModel.Design.DesignerVerbCollection Verbs
{
get
{
DesignerVerbCollection dvc = new DesignerVerbCollection();
dvc.Add( new DesignerVerb("Launch Color Builder UI", new EventHandler(this.launchColorBuilder)) );
return dvc;
}
}
// This method handles the "Launch Color Builder UI" menu command.
// Invokes the BuildColor method of the System.Web.UI.Design.ColorBuilder.
private void launchColorBuilder(object sender, EventArgs e)
{
// Create a parent control.
System.Windows.Forms.Control c = new System.Windows.Forms.Control();
c.CreateControl();
// Launch the Color Builder using the specified control
// parent and an initial HTML format ("RRGGBB") color string.
System.Web.UI.Design.ColorBuilder.BuildColor(this.Component, c, "405599");
}
}
// Example Web control displays the value of its text property.
// This control is associated with the ColorBuilderDesigner.
[DesignerAttribute(typeof(ColorBuilderDesigner), typeof(IDesigner))]
public class ColorBuilderControl : System.Web.UI.WebControls.WebControl
{
private string text;
[Bindable(true),
Category("Appearance"),
DefaultValue("")]
public string Text
{
get
{
return text;
}
set
{
text = value;
}
}
protected override void Render(HtmlTextWriter output)
{
output.Write(Text);
}
}