private void RegisterStyle(Style style) { if (Menu.Page != null && Menu.Page.SupportsStyleSheets) { string name = Menu.ClientID + "_" + _cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo); Menu.Page.Header.StyleSheet.CreateStyleRule(style, Menu, "." + name); style.SetRegisteredCssClass(name); } }
private void RegisterStyle(Style style) { if ((style != null) && !style.IsEmpty) { string cssClass = this._menuUser.ClientID + "__Menu_" + this._cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo); this._menuUser.Page.Header.StyleSheet.CreateStyleRule(style, this._menuUser.UrlResolver, "." + cssClass); style.SetRegisteredCssClass(cssClass); } }
public void RegisterStyle(Style baseStyle, string className, HtmlHead head) { if (head == null) { return; } if (String.IsNullOrEmpty(className)) { className = IncrementStyleClassName(); } baseStyle.SetRegisteredCssClass(className); head.StyleSheet.CreateStyleRule(baseStyle, Owner, "." + className); }
public void RegisterStyle (Style style, IUrlResolutionService urlResolver) { for (int n=0; n<entries.Count; n++) { if (((StyleEntry)entries[n]).Style == style) return; } string name = "aspnet_" + entries.Count; style.SetRegisteredCssClass (name); CreateStyleRule (style, urlResolver, "." + name); }
public void RegisterStyle (Style baseStyle, string className, HtmlHead head) { if (head == null) return; if (String.IsNullOrEmpty (className)) className = IncrementStyleClassName (); baseStyle.SetRegisteredCssClass (className); head.StyleSheet.CreateStyleRule (baseStyle, Owner, "." + className); }
void RegisterStyle (Style baseStyle) { if (Page.Header == null) return; string className = IncrementStyleClassName ().Trim ('_'); baseStyle.SetRegisteredCssClass (className); Page.Header.StyleSheet.CreateStyleRule (baseStyle, this, "." + className); }
private void RegisterStyle(Style style) { Debug.Assert(_page.SupportsStyleSheets); // The style should not have already been registered Debug.Assert(style.RegisteredCssClass.Length == 0); if (!style.IsEmpty) { string name = Zone.ClientID + "_" + _cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo); _page.Header.StyleSheet.CreateStyleRule(style, Zone, "." + name); style.SetRegisteredCssClass(name); } }
private void RegisterStyle(Style style) { Debug.Assert(_menuUser.Page != null && _menuUser.Page.SupportsStyleSheets); if (style != null && !style.IsEmpty) { // The style should not have already been registered Debug.Assert(style.RegisteredCssClass.Length == 0); string name = _menuUser.ClientID + "__Menu_" + _cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo); _menuUser.Page.Header.StyleSheet.CreateStyleRule(style, _menuUser.UrlResolver, "." + name); style.SetRegisteredCssClass(name); } }
private void RegisterStyle(Style style) { if (Menu.Page != null && Menu.Page.SupportsStyleSheets) { string name = Menu.ClientID + "_" + _cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo); Menu.Page.Header.StyleSheet.CreateStyleRule(style, Menu, "." + name); style.SetRegisteredCssClass(name); } }
private void RegisterStyle(Style style) { if (!style.IsEmpty) { string cssClass = this.Zone.ClientID + "_" + this._cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo); this._page.Header.StyleSheet.CreateStyleRule(style, this.Zone, "." + cssClass); style.SetRegisteredCssClass(cssClass); } }
void IStyleSheet.RegisterStyle(Style style, IUrlResolutionService urlResolver) { if (style == null) { throw new ArgumentNullException("style"); } if (_styles == null) { _styles = new ArrayList(); } else if (style.RegisteredCssClass.Length != 0) { // if it's already registered, throw an exception throw new InvalidOperationException(SR.GetString(SR.HtmlHead_StyleAlreadyRegistered)); } if (urlResolver == null) { urlResolver = this; } StyleInfo styleInfo = new StyleInfo(); styleInfo.style = style; styleInfo.urlResolver = urlResolver; int index = _autoGenCount++; string name = "aspnet_s" + index.ToString(NumberFormatInfo.InvariantInfo); style.SetRegisteredCssClass(name); _styles.Add(styleInfo); }
void IStyleSheet.RegisterStyle(Style style, IUrlResolutionService urlResolver) { if (style == null) { throw new ArgumentNullException("style"); } if (this._styles == null) { this._styles = new ArrayList(); } else if (style.RegisteredCssClass.Length != 0) { throw new InvalidOperationException(System.Web.SR.GetString("HtmlHead_StyleAlreadyRegistered")); } if (urlResolver == null) { urlResolver = this; } StyleInfo info = new StyleInfo { style = style, urlResolver = urlResolver }; string cssClass = "aspnet_s" + this._autoGenCount++.ToString(NumberFormatInfo.InvariantInfo); style.SetRegisteredCssClass(cssClass); this._styles.Add(info); }