Exemple #1
0
        /// <internalonly/>
        /// <devdoc>
        ///    <para>Copies non-blank elements from the specified style, overwriting existing
        ///       style elements if necessary.</para>
        /// </devdoc>
        public override void CopyFrom(Style s)
        {
            if (s != null && !s.IsEmpty)
            {
                base.CopyFrom(s);

                if (s is PanelStyle)
                {
                    PanelStyle ts = (PanelStyle)s;

                    if (s.RegisteredCssClass.Length != 0)
                    {
                        if (ts.IsSet(PROP_BACKIMAGEURL))
                        {
                            ViewState.Remove(STR_BACKIMAGEURL);
                            ClearBit(PROP_BACKIMAGEURL);
                        }
                        if (ts.IsSet(PROP_SCROLLBARS))
                        {
                            ViewState.Remove(STR_SCROLLBARS);
                            ClearBit(PROP_SCROLLBARS);
                        }
                        if (ts.IsSet(PROP_WRAP))
                        {
                            ViewState.Remove(STR_WRAP);
                            ClearBit(PROP_WRAP);
                        }
                    }
                    else
                    {
                        if (ts.IsSet(PROP_BACKIMAGEURL))
                        {
                            this.BackImageUrl = ts.BackImageUrl;
                        }
                        if (ts.IsSet(PROP_SCROLLBARS))
                        {
                            this.ScrollBars = ts.ScrollBars;
                        }
                        if (ts.IsSet(PROP_WRAP))
                        {
                            this.Wrap = ts.Wrap;
                        }
                    }

                    if (ts.IsSet(PROP_DIRECTION))
                    {
                        this.Direction = ts.Direction;
                    }
                    if (ts.IsSet(PROP_HORIZONTALALIGN))
                    {
                        this.HorizontalAlign = ts.HorizontalAlign;
                    }
                }
            }
        }
Exemple #2
0
 public override void CopyFrom(Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         base.CopyFrom(s);
         if (s is PanelStyle)
         {
             PanelStyle style = (PanelStyle)s;
             if (s.RegisteredCssClass.Length != 0)
             {
                 if (style.IsSet(0x10000))
                 {
                     base.ViewState.Remove("BackImageUrl");
                     base.ClearBit(0x10000);
                 }
                 if (style.IsSet(0x80000))
                 {
                     base.ViewState.Remove("ScrollBars");
                     base.ClearBit(0x80000);
                 }
                 if (style.IsSet(0x100000))
                 {
                     base.ViewState.Remove("Wrap");
                     base.ClearBit(0x100000);
                 }
             }
             else
             {
                 if (style.IsSet(0x10000))
                 {
                     this.BackImageUrl = style.BackImageUrl;
                 }
                 if (style.IsSet(0x80000))
                 {
                     this.ScrollBars = style.ScrollBars;
                 }
                 if (style.IsSet(0x100000))
                 {
                     this.Wrap = style.Wrap;
                 }
             }
             if (style.IsSet(0x20000))
             {
                 this.Direction = style.Direction;
             }
             if (style.IsSet(0x40000))
             {
                 this.HorizontalAlign = style.HorizontalAlign;
             }
         }
     }
 }
Exemple #3
0
        /// <internalonly/>
        /// <devdoc>
        ///    <para>Copies non-blank elements from the specified style, but will not overwrite
        ///       any existing style elements.</para>
        /// </devdoc>
        public override void MergeWith(Style s)
        {
            if (s != null && !s.IsEmpty)
            {
                if (IsEmpty)
                {
                    // merge into an empty style is equivalent to a copy,
                    // which is more efficient
                    CopyFrom(s);
                    return;
                }

                base.MergeWith(s);

                if (s is PanelStyle)
                {
                    PanelStyle ts = (PanelStyle)s;

                    // Since we're already copying the registered CSS class in base.MergeWith, we don't
                    // need to any attributes that would be included in that class.
                    if (s.RegisteredCssClass.Length == 0)
                    {
                        if (ts.IsSet(PROP_BACKIMAGEURL) && !this.IsSet(PROP_BACKIMAGEURL))
                        {
                            this.BackImageUrl = ts.BackImageUrl;
                        }
                        if (ts.IsSet(PROP_SCROLLBARS) && !this.IsSet(PROP_SCROLLBARS))
                        {
                            this.ScrollBars = ts.ScrollBars;
                        }
                        if (ts.IsSet(PROP_WRAP) && !this.IsSet(PROP_WRAP))
                        {
                            this.Wrap = ts.Wrap;
                        }
                    }

                    if (ts.IsSet(PROP_DIRECTION) && !this.IsSet(PROP_DIRECTION))
                    {
                        this.Direction = ts.Direction;
                    }
                    if (ts.IsSet(PROP_HORIZONTALALIGN) && !this.IsSet(PROP_HORIZONTALALIGN))
                    {
                        this.HorizontalAlign = ts.HorizontalAlign;
                    }
                }
            }
        }
Exemple #4
0
 public override void MergeWith(Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         if (this.IsEmpty)
         {
             this.CopyFrom(s);
         }
         else
         {
             base.MergeWith(s);
             if (s is PanelStyle)
             {
                 PanelStyle style = (PanelStyle)s;
                 if (s.RegisteredCssClass.Length == 0)
                 {
                     if (style.IsSet(0x10000) && !base.IsSet(0x10000))
                     {
                         this.BackImageUrl = style.BackImageUrl;
                     }
                     if (style.IsSet(0x80000) && !base.IsSet(0x80000))
                     {
                         this.ScrollBars = style.ScrollBars;
                     }
                     if (style.IsSet(0x100000) && !base.IsSet(0x100000))
                     {
                         this.Wrap = style.Wrap;
                     }
                 }
                 if (style.IsSet(0x20000) && !base.IsSet(0x20000))
                 {
                     this.Direction = style.Direction;
                 }
                 if (style.IsSet(0x40000) && !base.IsSet(0x40000))
                 {
                     this.HorizontalAlign = style.HorizontalAlign;
                 }
             }
         }
     }
 }
        public override void MergeWith(Style s)
        {
            if ((s == null) || (s.IsEmpty))
            {
                return;
            }

            base.MergeWith(s);

            PanelStyle ps = s as PanelStyle;

            if (ps == null)
            {
                return;
            }

            if (!CheckBit((int)PanelStyles.BackImageUrl) && s.CheckBit((int)PanelStyles.BackImageUrl))
            {
                this.BackImageUrl = ps.BackImageUrl;
            }
            if (!CheckBit((int)PanelStyles.Direction) && s.CheckBit((int)PanelStyles.Direction))
            {
                this.Direction = ps.Direction;
            }
            if (!CheckBit((int)PanelStyles.HorizontalAlign) && s.CheckBit((int)PanelStyles.HorizontalAlign))
            {
                this.HorizontalAlign = ps.HorizontalAlign;
            }
            if (!CheckBit((int)PanelStyles.ScrollBars) && s.CheckBit((int)PanelStyles.ScrollBars))
            {
                this.ScrollBars = ps.ScrollBars;
            }
            if (!CheckBit((int)PanelStyles.Wrap) && s.CheckBit((int)PanelStyles.Wrap))
            {
                this.Wrap = ps.Wrap;
            }
        }