当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTextWriterStyle类代码示例

本文整理汇总了C#中HtmlTextWriterStyle的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriterStyle类的具体用法?C# HtmlTextWriterStyle怎么用?C# HtmlTextWriterStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HtmlTextWriterStyle类属于命名空间,在下文中一共展示了HtmlTextWriterStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddStyleAttribute

		protected override void AddStyleAttribute (string name, string value, HtmlTextWriterStyle key)
		{
			output.WriteLine ("{0:###0} AddStyleAttribute ({1}, {2}, {3}))", NextIndex (), name, value, key);
			if (full_trace)
				WriteTrace (new StackTrace ());

			base.AddStyleAttribute (name, value, key);
		}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:HtmlWriter.cs

示例2: OnStyleAttributeRender

 protected override bool OnStyleAttributeRender(string name, string value, HtmlTextWriterStyle key)
 {
     if ((key == HtmlTextWriterStyle.TextDecoration) && StringUtil.EqualsIgnoreCase("line-through", value))
     {
         return false;
     }
     return base.OnStyleAttributeRender(name, value, key);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ChtmlTextWriter.cs

示例3: RegisterStyle

		public NamedCssStyleCollection RegisterStyle (HtmlTextWriterStyle key, string value, string styleName = null)
		{
			if (styleName == null)
				styleName = String.Empty;

			NamedCssStyleCollection style = GetStyle (styleName);
			style.Add (key, value);

			return style;
		}
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:StyleBlock.cs

示例4: StyleConversion

 public string this[HtmlTextWriterStyle style]
 {
     get
     {
         return this[new StyleConversion(style).CssStyleName];
     }
     set
     {
         this[new StyleConversion(style).CssStyleName] = value;
     }
 }
开发者ID:BryanApellanes,项目名称:Naizari,代码行数:11,代码来源:JsonStyles.cs

示例5: Add

 public void Add(HtmlTextWriterStyle key, string value)
 {
     if (this._intTable == null)
     {
         this._intTable = new HybridDictionary();
     }
     this._intTable[(int) key] = value;
     string styleName = CssTextWriter.GetStyleName(key);
     if (styleName.Length != 0)
     {
         if (this._table == null)
         {
             this.ParseString();
         }
         this._table.Remove(styleName);
     }
     if (this._state != null)
     {
         this._state["style"] = this.BuildString();
     }
     this._style = null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:CssStyleCollection.cs

示例6: OnStyleAttributeRender

        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        protected override bool OnStyleAttributeRender(string name,string value, HtmlTextWriterStyle key) {

            string s;
            if (Supports(FONT_AROUND_CONTENT)) {
                // tag supports downlevel fonts
                switch (key) {
                    case HtmlTextWriterStyle.FontFamily:
                        _fontFace = value;
                        _renderFontTag = true;
                        break;
                    case HtmlTextWriterStyle.Color:
                        _fontColor = value;
                        _renderFontTag = true;
                        break;
                    case HtmlTextWriterStyle.FontSize:
                        _fontSize = ConvertToHtmlFontSize(value);
                        if (_fontSize != null)
                            _renderFontTag = true;
                        break;
                    case HtmlTextWriterStyle.FontWeight:
                        if (StringUtil.EqualsIgnoreCase(value, "bold") && SupportsBold) {
                            AppendOtherTag("b");
                        }
                        break;
                    case HtmlTextWriterStyle.FontStyle:
                        if (!StringUtil.EqualsIgnoreCase(value, "normal") && SupportsItalic) {
                            AppendOtherTag("i");
                        }
                        break;
                    case HtmlTextWriterStyle.TextDecoration:
                        s = value.ToLower(CultureInfo.InvariantCulture);
                        if (s.IndexOf("underline", StringComparison.Ordinal) != -1) {
                            AppendOtherTag("u");
                        }
                        if (s.IndexOf("line-through", StringComparison.Ordinal) != -1) {
                            AppendOtherTag("strike");
                        }
                        break;
                }
            }
            else if (Supports(FONT_PROPAGATE)) {
                FontStackItem font = (FontStackItem)FontStack.Peek();

                switch (key) {
                    case HtmlTextWriterStyle.FontFamily:
                        font.name = value;
                        break;
                    case HtmlTextWriterStyle.Color:
                        font.color = value;
                        break;
                    case HtmlTextWriterStyle.FontSize:
                        font.size = ConvertToHtmlFontSize(value);
                        break;
                    case HtmlTextWriterStyle.FontWeight:
                        if (StringUtil.EqualsIgnoreCase(value, "bold")) {
                            font.bold = true;
                        }
                        break;
                    case HtmlTextWriterStyle.FontStyle:
                        if (!StringUtil.EqualsIgnoreCase(value, "normal")) {
                            font.italic = true;
                        }
                        break;
                    case HtmlTextWriterStyle.TextDecoration:
                        s = value.ToLower(CultureInfo.InvariantCulture);
                        if (s.IndexOf("underline", StringComparison.Ordinal) != -1) {
                            font.underline = true;
                        }
                        if (s.IndexOf("line-through", StringComparison.Ordinal) != -1) {
                            font.strikeout = true;
                        }
                        break;
                }
            }

            if (Supports(SUPPORTS_BORDER) && key == HtmlTextWriterStyle.BorderWidth) {
                s = ConvertToHtmlSize(value);
                if (s != null)
                    AddAttribute(HtmlTextWriterAttribute.Border,s);
            }

            if (Supports(SUPPORTS_NOWRAP) && key == HtmlTextWriterStyle.WhiteSpace) {
                AddAttribute(HtmlTextWriterAttribute.Nowrap, value);
            }

            if (Supports(SUPPORTS_HEIGHT_WIDTH)) {
                switch (key) {
                    case HtmlTextWriterStyle.Height :
                        s = ConvertToHtmlSize(value);
                        if (s != null)
                            AddAttribute(HtmlTextWriterAttribute.Height,s);
                        break;
                    case HtmlTextWriterStyle.Width :
                        s = ConvertToHtmlSize(value);
                        if (s != null)
                            AddAttribute(HtmlTextWriterAttribute.Width,s);
                        break;
//.........这里部分代码省略.........
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:101,代码来源:Html32TextWriter.cs

示例7: Style

 public HtmlAttributeManager Style(HtmlTextWriterStyle key, string value)
 {
     Writer.AddStyleAttribute(key, value);
     return this;
 }
开发者ID:draizada,项目名称:IZWebFileManager,代码行数:5,代码来源:HtmlAttributeManager.cs

示例8: WriteAttribute

 /// <devdoc>
 /// Render out the specified style attribute and value.
 /// </devdoc>
 public void WriteAttribute(HtmlTextWriterStyle key, string value) {
     WriteAttribute(_writer, key, GetStyleName(key), value);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:6,代码来源:CssTextWriter.cs

示例9: RegisterAttribute

 /// <internalonly/>
 /// <devdoc>
 /// Registers the specified style attribute to create a mapping between a string representation
 /// and the corresponding HtmlTextWriterStyle value.
 /// </devdoc>
 internal static void RegisterAttribute(string name, HtmlTextWriterStyle key, bool encode) {
     RegisterAttribute(name, key, encode, false);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:CssTextWriter.cs

示例10: GetStyleName

        /// <devdoc>
        /// Returns the name of the attribute corresponding to the specified HtmlTextWriterStyle value.
        /// </devdoc>
        public static string GetStyleName(HtmlTextWriterStyle styleKey) {
            if ((int)styleKey >= 0 && (int)styleKey < attrNameLookupArray.Length) {
                return attrNameLookupArray[(int)styleKey].name;
            }

            return String.Empty;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:CssTextWriter.cs

示例11: StyleAttribute

 public StyleAttribute(HtmlTextWriterStyle style, string value)
 {
     Value = value;
     StyleString = StyleToString(style);
 }
开发者ID:TomDrJones,项目名称:NUnitGo,代码行数:5,代码来源:StyleAttribute.cs

示例12: Add

 public void Add (HtmlTextWriterStyle key, string value)
 {
 }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:3,代码来源:System.Web.UI.CssStyleCollection.cs

示例13: return

 /// <devdoc>
 /// Gets or sets the specified known CSS value.
 /// </devdoc>
 public string this[HtmlTextWriterStyle key] {
     get {
         if (_intTable == null) {
             return null;
         }
         return (string)_intTable[(int)key];
     }
     set {
         Add(key, value);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:14,代码来源:CssStyleCollection.cs

示例14: Remove

        public void Remove(HtmlTextWriterStyle key) {
            if (_intTable == null) {
                return;
            }
            _intTable.Remove((int)key);

            if (_state != null) {
                // keep style attribute synchronized
                _state["style"] = BuildString();
            }
            _style = null;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:12,代码来源:CssStyleCollection.cs

示例15: Add

        public void Add(HtmlTextWriterStyle key, string value) {
            if (_intTable == null) {
                _intTable = new HybridDictionary();
            }
            _intTable[(int)key] = value;

            string name = CssTextWriter.GetStyleName(key);
            if (name.Length != 0) {
                // Remove from the other table to avoid duplicates.
                if (_table == null)
                    ParseString();

                _table.Remove(name);
            }

            if (_state != null) {
                // keep style attribute synchronized
                _state["style"] = BuildString();
            }
            _style = null;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:21,代码来源:CssStyleCollection.cs


注:本文中的HtmlTextWriterStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。