本文整理汇总了C#中System.Web.UI.WebControls.Style.SetRegisteredCssClass方法的典型用法代码示例。如果您正苦于以下问题:C# Style.SetRegisteredCssClass方法的具体用法?C# Style.SetRegisteredCssClass怎么用?C# Style.SetRegisteredCssClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Style
的用法示例。
在下文中一共展示了Style.SetRegisteredCssClass方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterStyle
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);
}
}
示例2: RegisterStyle
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);
}
示例3: RegisterStyle
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);
}
示例4: RegisterStyle
void RegisterStyle (Style baseStyle)
{
if (Page.Header == null)
return;
string className = IncrementStyleClassName ().Trim ('_');
baseStyle.SetRegisteredCssClass (className);
Page.Header.StyleSheet.CreateStyleRule (baseStyle, this, "." + className);
}
示例5: RegisterStyle
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);
}
}
示例6: RegisterStyle
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);
}
}
示例7: RegisterStyle
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);
}
}
示例8: RegisterStyle
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);
}
}
示例9: ArgumentNullException
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);
}
示例10: ArgumentNullException
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);
}