本文整理汇总了C#中System.Web.UI.WebControls.Style类的典型用法代码示例。如果您正苦于以下问题:C# Style类的具体用法?C# Style怎么用?C# Style使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Style类属于System.Web.UI.WebControls命名空间,在下文中一共展示了Style类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyFrom
public override void CopyFrom(Style s)
{
if ((s != null) && !s.IsEmpty)
{
base.CopyFrom(s);
if (s is TableItemStyle)
{
TableItemStyle style = (TableItemStyle) s;
if (s.RegisteredCssClass.Length != 0)
{
if (style.IsSet(0x40000))
{
base.ViewState.Remove("Wrap");
base.ClearBit(0x40000);
}
}
else if (style.IsSet(0x40000))
{
this.Wrap = style.Wrap;
}
if (style.IsSet(0x10000))
{
this.HorizontalAlign = style.HorizontalAlign;
}
if (style.IsSet(0x20000))
{
this.VerticalAlign = style.VerticalAlign;
}
}
}
}
示例2: CopyFrom
public override void CopyFrom(Style s)
{
if (s != null)
{
base.CopyFrom(s);
SubMenuStyle style = s as SubMenuStyle;
if ((style != null) && !style.IsEmpty)
{
if (s.RegisteredCssClass.Length != 0)
{
if (style.IsSet(0x10000))
{
base.ViewState.Remove("VerticalPadding");
base.ClearBit(0x10000);
}
if (style.IsSet(0x20000))
{
base.ViewState.Remove("HorizontalPadding");
base.ClearBit(0x20000);
}
}
else
{
if (style.IsSet(0x10000))
{
this.VerticalPadding = style.VerticalPadding;
}
if (style.IsSet(0x20000))
{
this.HorizontalPadding = style.HorizontalPadding;
}
}
}
}
}
示例3: CreateTemplateEditingFrame
protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
{
ITemplateEditingService service = (ITemplateEditingService) this.GetService(typeof(ITemplateEditingService));
DataGrid viewControl = (DataGrid) base.ViewControl;
Style[] templateStyles = new Style[] { viewControl.ItemStyle, viewControl.EditItemStyle, viewControl.HeaderStyle, viewControl.FooterStyle };
return service.CreateFrame(this, verb.Text, ColumnTemplateNames, viewControl.ControlStyle, templateStyles);
}
示例4: DynamicMenuPopoutGroup
//***************************************************************************
// Class Constructors
//
public DynamicMenuPopoutGroup(DynamicMenuItemCollection items, Style itemStyle, Style activeStyle, Style hoverStyle)
: base(null, itemStyle, activeStyle, hoverStyle)
{
this._assocDivs = new Collections.StringCollection();
this._menuItems = items;
//this._menuItems.Updated += new Collections.CollectionEventHandler(menuItems_Updated);
}
示例5: RenderRepeater
// What is baseControl for ?
public void RenderRepeater (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
{
PrintValues (user);
RepeatLayout layout = RepeatLayout;
bool listLayout = layout == RepeatLayout.OrderedList || layout == RepeatLayout.UnorderedList;
if (listLayout) {
if (user != null) {
if ((user.HasHeader || user.HasFooter || user.HasSeparators))
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts do not support headers, footers or separators.");
}
if (OuterTableImplied)
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts do not support implied outer tables.");
int cols = RepeatColumns;
if (cols > 1)
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts do not support multi-column layouts.");
}
if (RepeatDirection == RepeatDirection.Vertical) {
if (listLayout)
RenderList (w, user, controlStyle, baseControl);
else
RenderVert (w, user, controlStyle, baseControl);
} else {
if (listLayout)
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts only support vertical layout.");
RenderHoriz (w, user, controlStyle, baseControl);
}
}
示例6: Add
public NamedCssStyleCollection Add (Style style)
{
if (style != null)
CopyFrom (style.GetStyleAttributes (null));
return this;
}
示例7: GetLoginInterface
/// <summary>
/// Must create and return the control
/// that will show the logon interface.
/// If none is available returns null
/// </summary>
public Control GetLoginInterface(Style controlStyle)
{
this._uIdTable = new Table();
TableCell cell = new TableCell();
TableRow row = new TableRow();
Button child = new Button();
child.Click += new EventHandler(this.OnUIdSubmit);
this._uIdTextBox = new TextBox();
this._uIdTextBox.CssClass = "lddl";
//this._uIdTable.ControlStyle.Font.CopyFrom(controlStyle.Font);
this._uIdTable.ControlStyle.CssClass = "tablelddl ";
this._uIdTable.Width = Unit.Percentage(100.0);
child.Text = ResourceManager.GetString("SubmitUId");
child.CssClass = "btn btn-primary btn-xs bw";
cell.Controls.Add(new LiteralControl(ResourceManager.GetString("EnterUIdMessage", this.LanguageCode)));
row.Cells.Add(cell);
this._uIdTable.Rows.Add(row);
cell = new TableCell();
row = new TableRow();
cell.Controls.Add(this._uIdTextBox);
cell.Controls.Add(child);
row.Cells.Add(cell);
this._uIdTable.Rows.Add(row);
return this._uIdTable;
}
示例8: CopyFrom
/// <devdoc>
/// Copies non-blank elements from the specified style, overwriting existing
/// style elements if necessary.
/// </devdoc>
public override void CopyFrom(Style s) {
if (s != null) {
base.CopyFrom(s);
SubMenuStyle sms = s as SubMenuStyle;
if (sms != null && !sms.IsEmpty) {
// Only copy the paddings if they aren't in the source Style's registered CSS class
if (s.RegisteredCssClass.Length != 0) {
if (sms.IsSet(PROP_VPADDING)) {
ViewState.Remove("VerticalPadding");
ClearBit(PROP_VPADDING);
}
if (sms.IsSet(PROP_HPADDING)) {
ViewState.Remove("HorizontalPadding");
ClearBit(PROP_HPADDING);
}
}
else {
if (sms.IsSet(PROP_VPADDING)) {
this.VerticalPadding = sms.VerticalPadding;
}
if (sms.IsSet(PROP_HPADDING)) {
this.HorizontalPadding = sms.HorizontalPadding;
}
}
}
}
}
示例9: CopyFrom
public override void CopyFrom(Style s)
{
if ((s != null) && !s.IsEmpty)
{
base.CopyFrom(s);
if (s is DataGridPagerStyle)
{
DataGridPagerStyle style = (DataGridPagerStyle) s;
if (style.IsSet(0x80000))
{
this.Mode = style.Mode;
}
if (style.IsSet(0x100000))
{
this.NextPageText = style.NextPageText;
}
if (style.IsSet(0x200000))
{
this.PrevPageText = style.PrevPageText;
}
if (style.IsSet(0x400000))
{
this.PageButtonCount = style.PageButtonCount;
}
if (style.IsSet(0x800000))
{
this.Position = style.Position;
}
if (style.IsSet(0x1000000))
{
this.Visible = style.Visible;
}
}
}
}
示例10: BuildRow
/// <summary>
/// Build a row with the given control and style
/// </summary>
/// <param name="child"></param>
/// <param name="rowStyle"></param>
/// <param name="labelText"></param>
/// <returns></returns>
protected TableRow BuildRow(Control child, string labelText, Style rowStyle)
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
if (labelText != null)
{
Label label = new Label();
label.ControlStyle.Font.Bold = true;
label.Text = labelText;
cell.Controls.Add(label);
cell.Wrap = false;
if (child == null) cell.ColumnSpan = 2;
cell.VerticalAlign = VerticalAlign.Top;
row.Cells.Add(cell);
cell = new TableCell();
}
else
{
cell.ColumnSpan = 2;
}
if (child != null)
{
cell.Controls.Add(child);
}
row.Cells.Add(cell);
row.ControlStyle.CopyFrom(rowStyle); //CSS .addinsLayout
return row;
}
示例11: CreateEditorPartChromeStyle
protected virtual Style CreateEditorPartChromeStyle(EditorPart editorPart, PartChromeType chromeType)
{
if (editorPart == null)
{
throw new ArgumentNullException("editorPart");
}
if ((chromeType < PartChromeType.Default) || (chromeType > PartChromeType.BorderOnly))
{
throw new ArgumentOutOfRangeException("chromeType");
}
if ((chromeType == PartChromeType.BorderOnly) || (chromeType == PartChromeType.TitleAndBorder))
{
return this.Zone.PartChromeStyle;
}
if (this._chromeStyleNoBorder == null)
{
Style style = new Style();
style.CopyFrom(this.Zone.PartChromeStyle);
if (style.BorderStyle != BorderStyle.None)
{
style.BorderStyle = BorderStyle.None;
}
if (style.BorderWidth != Unit.Empty)
{
style.BorderWidth = Unit.Empty;
}
if (style.BorderColor != Color.Empty)
{
style.BorderColor = Color.Empty;
}
this._chromeStyleNoBorder = style;
}
return this._chromeStyleNoBorder;
}
示例12: CreateControlStyle
protected override Style CreateControlStyle ()
{
Style s = new Style (new StateBag ());
s.BackColor = Color.Red;
s.BorderColor = Color.Red;
return s;
}
示例13: GetAdministrationInterface
/// <summary>
/// Must create and return the control
/// that will show the administration interface
/// If none is available returns null
/// </summary>
public Control GetAdministrationInterface(Style controlStyle)
{
this._adminTable = new Table();
this._adminTable.ControlStyle.CopyFrom(controlStyle);
this._adminTable.Width = Unit.Percentage(100);
TableCell cell = new TableCell();
TableRow row = new TableRow();
cell.ColumnSpan = 2;
cell.Text = ResourceManager.GetString("NSurveySecurityAddinDescription", this.LanguageCode);
row.Cells.Add(cell);
this._adminTable.Rows.Add(row);
cell = new TableCell();
row = new TableRow();
CheckBox child = new CheckBox();
child.Checked = new Surveys().NSurveyAllowsMultipleSubmissions(this.SurveyId);
Label label = new Label();
label.ControlStyle.Font.Bold = true;
label.Text = ResourceManager.GetString("MultipleSubmissionsLabel", this.LanguageCode);
cell.Width = Unit.Percentage(50);
cell.Controls.Add(label);
row.Cells.Add(cell);
cell = new TableCell();
child.CheckedChanged += new EventHandler(this.OnCheckBoxChange);
child.AutoPostBack = true;
cell.Controls.Add(child);
Unit.Percentage(50);
row.Cells.Add(cell);
this._adminTable.Rows.Add(row);
return this._adminTable;
}
示例14: AddStyles
public StyleBlockStyles AddStyles(Style style)
{
if (style != null)
{
this.AddStyles(style.GetStyleAttributes(this._styleControl));
}
return this;
}
示例15: CopyStyle
private void CopyStyle(Style toStyle, Style fromStyle)
{
if ((fromStyle != null) && fromStyle.IsSet(0x2000))
{
toStyle.Font.Underline = fromStyle.Font.Underline;
}
toStyle.CopyFrom(fromStyle);
}