當前位置: 首頁>>代碼示例>>C#>>正文


C# Style.IsSet方法代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.Style.IsSet方法的典型用法代碼示例。如果您正苦於以下問題:C# Style.IsSet方法的具體用法?C# Style.IsSet怎麽用?C# Style.IsSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.UI.WebControls.Style的用法示例。


在下文中一共展示了Style.IsSet方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CopyStyle

 private void CopyStyle(Style toStyle, Style fromStyle)
 {
     if ((fromStyle != null) && fromStyle.IsSet(0x2000))
     {
         toStyle.Font.Underline = fromStyle.Font.Underline;
     }
     toStyle.CopyFrom(fromStyle);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:SiteMapPath.cs

示例2: CopyStyle

        private void CopyStyle(Style toStyle, Style fromStyle) {
            Debug.Assert(toStyle != null);

            // Review: How to change the default value of Font.Underline?
            if (fromStyle != null && fromStyle.IsSet(System.Web.UI.WebControls.Style.PROP_FONT_UNDERLINE))
                toStyle.Font.Underline = fromStyle.Font.Underline;

            toStyle.CopyFrom(fromStyle);
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:9,代碼來源:SiteMapPath.cs

示例3: MergeWith

        /// <devdoc>
        /// Copies non-blank elements from the specified style,
        /// but will not overwrite any existing style elements.
        /// </devdoc>
        public virtual void MergeWith(Style s) {
            if (RegisteredCssClass.Length != 0) {
                throw new InvalidOperationException(SR.GetString(SR.Style_RegisteredStylesAreReadOnly));
            }

            if (s == null || s.IsEmpty)
                return;

            if (IsEmpty) {
                // merge into an empty style is equivalent to a copy, which
                // is more efficient
                CopyFrom(s);
                return;
            }

            this.Font.MergeWith(s.Font);

            if (s.IsSet(PROP_CSSCLASS) && !this.IsSet(PROP_CSSCLASS))
                this.CssClass = s.CssClass;

            // If the source Style is registered and this one isn't, copy
            // the CSS class and any style props not included in the CSS class
            // if they aren't set on this Style
            if (s.RegisteredCssClass.Length == 0) {
                if (s.IsSet(PROP_BACKCOLOR) && (!this.IsSet(PROP_BACKCOLOR) || (BackColor == Color.Empty)))
                    this.BackColor = s.BackColor;
                if (s.IsSet(PROP_FORECOLOR) && (!this.IsSet(PROP_FORECOLOR) || (ForeColor == Color.Empty)))
                    this.ForeColor = s.ForeColor;
                if (s.IsSet(PROP_BORDERCOLOR) && (!this.IsSet(PROP_BORDERCOLOR) || (BorderColor == Color.Empty)))
                    this.BorderColor = s.BorderColor;
                if (s.IsSet(PROP_BORDERWIDTH) && (!this.IsSet(PROP_BORDERWIDTH) || (BorderWidth == Unit.Empty)))
                    this.BorderWidth = s.BorderWidth;
                if (s.IsSet(PROP_BORDERSTYLE) && !this.IsSet(PROP_BORDERSTYLE))
                    this.BorderStyle = s.BorderStyle;
                if (s.IsSet(PROP_HEIGHT) && (!this.IsSet(PROP_HEIGHT) || (Height == Unit.Empty)))
                    this.Height = s.Height;
                if (s.IsSet(PROP_WIDTH) && (!this.IsSet(PROP_WIDTH) || (Width == Unit.Empty)))
                    this.Width = s.Width;
            }
            else {
                if (IsSet(PROP_CSSCLASS)) {
                    CssClass += " " + s.RegisteredCssClass;
                }
                else {
                    CssClass = s.RegisteredCssClass;
                }
            }
        }
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:52,代碼來源:Style.cs

示例4: CopyFrom

        /// <devdoc>
        ///    <para>
        ///       Copies non-blank elements from the specified style,
        ///       overwriting existing style elements if necessary.
        ///    </para>
        /// </devdoc>
        public virtual void CopyFrom(Style s) {
            if (RegisteredCssClass.Length != 0) {
                throw new InvalidOperationException(SR.GetString(SR.Style_RegisteredStylesAreReadOnly));
            }

            if (s != null && !s.IsEmpty) {
                this.Font.CopyFrom(s.Font);

                if (s.IsSet(PROP_CSSCLASS))
                    this.CssClass = s.CssClass;


                // if the source Style is registered and this one isn't,
                // reset all the styles set by the source Style so it's
                // css class can be used to set those values
                if (s.RegisteredCssClass.Length != 0) {
                    if (IsSet(PROP_CSSCLASS)) {
                        CssClass += " " + s.RegisteredCssClass;
                    }
                    else {
                        CssClass = s.RegisteredCssClass;
                    }

                    if (s.IsSet(PROP_BACKCOLOR) && (s.BackColor != Color.Empty)) {
                        ViewState.Remove("BackColor");
                        ClearBit(PROP_BACKCOLOR);
                    }
                    if (s.IsSet(PROP_FORECOLOR) && (s.ForeColor != Color.Empty)) {
                        ViewState.Remove("ForeColor");
                        ClearBit(PROP_FORECOLOR);
                    }
                    if (s.IsSet(PROP_BORDERCOLOR) && (s.BorderColor != Color.Empty)) {
                        ViewState.Remove("BorderColor");
                        ClearBit(PROP_BORDERCOLOR);
                    }
                    if (s.IsSet(PROP_BORDERWIDTH) && (s.BorderWidth != Unit.Empty)) {
                        ViewState.Remove("BorderWidth");
                        ClearBit(PROP_BORDERWIDTH);
                    }
                    if (s.IsSet(PROP_BORDERSTYLE)) {
                        ViewState.Remove("BorderStyle");
                        ClearBit(PROP_BORDERSTYLE);
                    }
                    if (s.IsSet(PROP_HEIGHT) && (s.Height != Unit.Empty)) {
                        ViewState.Remove("Height");
                        ClearBit(PROP_HEIGHT);
                    }
                    if (s.IsSet(PROP_WIDTH) && (s.Width != Unit.Empty)) {
                        ViewState.Remove("Width");
                        ClearBit(PROP_WIDTH);
                    }
                }
                else {
                    if (s.IsSet(PROP_BACKCOLOR) && (s.BackColor != Color.Empty))
                        this.BackColor = s.BackColor;
                    if (s.IsSet(PROP_FORECOLOR) && (s.ForeColor != Color.Empty))
                        this.ForeColor = s.ForeColor;
                    if (s.IsSet(PROP_BORDERCOLOR) && (s.BorderColor != Color.Empty))
                        this.BorderColor = s.BorderColor;
                    if (s.IsSet(PROP_BORDERWIDTH) && (s.BorderWidth != Unit.Empty))
                        this.BorderWidth = s.BorderWidth;
                    if (s.IsSet(PROP_BORDERSTYLE))
                        this.BorderStyle = s.BorderStyle;
                    if (s.IsSet(PROP_HEIGHT) && (s.Height != Unit.Empty))
                        this.Height = s.Height;
                    if (s.IsSet(PROP_WIDTH) && (s.Width != Unit.Empty))
                        this.Width = s.Width;
                }
            }
        }
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:76,代碼來源:Style.cs

示例5: CopyTextStylesFrom

		internal virtual void CopyTextStylesFrom (Style source)
		{
			if (source.IsSet (FORECOLOR)&& (source.ForeColor != Color.Empty))
				ForeColor = source.ForeColor;
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:5,代碼來源:Style.cs

示例6: CopyFrom

		public virtual void CopyFrom (Style source)
		{
			if (source == null || source.IsEmpty)
				return;

			Font.CopyFrom (source.Font);
			if (source.IsSet (HEIGHT)&& (source.Height != Unit.Empty))
				Height = source.Height;

			if (source.IsSet (WIDTH)&& (source.Width != Unit.Empty))
				Width = source.Width;

			if (source.IsSet (BORDERCOLOR)&& (source.BorderColor != Color.Empty))
				BorderColor = source.BorderColor;

			if (source.IsSet (BORDERWIDTH)&& (source.BorderWidth != Unit.Empty))
				BorderWidth = source.BorderWidth;

			if (source.IsSet (BORDERSTYLE))
				BorderStyle = source.BorderStyle;

			if (source.IsSet (BACKCOLOR)&& (source.BackColor != Color.Empty))
				BackColor = source.BackColor;

			if (source.IsSet (CSSCLASS))
				CssClass = source.CssClass;

			if (source.IsSet (FORECOLOR)&& (source.ForeColor != Color.Empty))
				ForeColor = source.ForeColor;

		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:31,代碼來源:Style.cs


注:本文中的System.Web.UI.WebControls.Style.IsSet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。