public override void MergeWith(Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         if (this.IsEmpty)
         {
             this.CopyFrom(s);
         }
         else
         {
             base.MergeWith(s);
             if (s is TableItemStyle)
             {
                 TableItemStyle style = (TableItemStyle)s;
                 if (((s.RegisteredCssClass.Length == 0) && style.IsSet(0x40000)) && !base.IsSet(0x40000))
                 {
                     this.Wrap = style.Wrap;
                 }
                 if (style.IsSet(0x10000) && !base.IsSet(0x10000))
                 {
                     this.HorizontalAlign = style.HorizontalAlign;
                 }
                 if (style.IsSet(0x20000) && !base.IsSet(0x20000))
                 {
                     this.VerticalAlign = style.VerticalAlign;
                 }
             }
         }
     }
 }
 public override void CopyFrom(Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         base.CopyFrom(s);
         if (s is TableItemStyle)
         {
             TableItemStyle style = (TableItemStyle)s;
             if (s.RegisteredCssClass.Length != 0)
             {
                 if (style.IsSet(0x40000))
                 {
                     base.ViewState.Remove("Wrap");
                     base.ClearBit(0x40000);
                 }
             }
             else if (style.IsSet(0x40000))
             {
                 this.Wrap = style.Wrap;
             }
             if (style.IsSet(0x10000))
             {
                 this.HorizontalAlign = style.HorizontalAlign;
             }
             if (style.IsSet(0x20000))
             {
                 this.VerticalAlign = style.VerticalAlign;
             }
         }
     }
 }
예제 #3
0
        /// <include file='doc\TableItemStyle.uex' path='docs/doc[@for="TableItemStyle.MergeWith"]/*' />
        /// <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 TableItemStyle)
                {
                    TableItemStyle ts = (TableItemStyle)s;

                    if (ts.IsSet(PROP_HORZALIGN) && !this.IsSet(PROP_HORZALIGN))
                    {
                        this.HorizontalAlign = ts.HorizontalAlign;
                    }
                    if (ts.IsSet(PROP_VERTALIGN) && !this.IsSet(PROP_VERTALIGN))
                    {
                        this.VerticalAlign = ts.VerticalAlign;
                    }
                    if (ts.IsSet(PROP_WRAP) && !this.IsSet(PROP_WRAP))
                    {
                        this.Wrap = ts.Wrap;
                    }
                }
            }
        }
예제 #4
0
        /// <include file='doc\TableItemStyle.uex' path='docs/doc[@for="TableItemStyle.CopyFrom"]/*' />
        /// <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 TableItemStyle)
                {
                    TableItemStyle ts = (TableItemStyle)s;

                    if (ts.IsSet(PROP_HORZALIGN))
                    {
                        this.HorizontalAlign = ts.HorizontalAlign;
                    }
                    if (ts.IsSet(PROP_VERTALIGN))
                    {
                        this.VerticalAlign = ts.VerticalAlign;
                    }
                    if (ts.IsSet(PROP_WRAP))
                    {
                        this.Wrap = ts.Wrap;
                    }
                }
            }
        }
예제 #5
0
        /// <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 TableItemStyle)
                {
                    TableItemStyle ts = (TableItemStyle)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_WRAP) && !this.IsSet(PROP_WRAP))
                        {
                            this.Wrap = ts.Wrap;
                        }
                    }

                    if (ts.IsSet(PROP_HORZALIGN) && !this.IsSet(PROP_HORZALIGN))
                    {
                        this.HorizontalAlign = ts.HorizontalAlign;
                    }
                    if (ts.IsSet(PROP_VERTALIGN) && !this.IsSet(PROP_VERTALIGN))
                    {
                        this.VerticalAlign = ts.VerticalAlign;
                    }
                }
            }
        }
예제 #6
0
        /// <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 TableItemStyle)
                {
                    TableItemStyle ts = (TableItemStyle)s;

                    if (s.RegisteredCssClass.Length != 0)
                    {
                        if (ts.IsSet(PROP_WRAP))
                        {
                            ViewState.Remove("Wrap");
                            ClearBit(PROP_WRAP);
                        }
                    }
                    else
                    {
                        if (ts.IsSet(PROP_WRAP))
                        {
                            this.Wrap = ts.Wrap;
                        }
                    }

                    if (ts.IsSet(PROP_HORZALIGN))
                    {
                        this.HorizontalAlign = ts.HorizontalAlign;
                    }
                    if (ts.IsSet(PROP_VERTALIGN))
                    {
                        this.VerticalAlign = ts.VerticalAlign;
                    }
                }
            }
        }
 internal void ApplyLayoutStyleToInnerCells(TableItemStyle tableItemStyle)
 {
     for (int i = 0; i < this._innerCells.Length; i++)
     {
         if (tableItemStyle.IsSet(0x10000))
         {
             this._innerCells[i].HorizontalAlign = tableItemStyle.HorizontalAlign;
         }
         if (tableItemStyle.IsSet(0x20000))
         {
             this._innerCells[i].VerticalAlign = tableItemStyle.VerticalAlign;
         }
     }
 }
            internal void ApplyLayoutStyleToInnerCells(TableItemStyle tableItemStyle) {
                // VSWhidbey 401891, apply the table layout styles to the innercells.
                for (int i = 0; i < _innerCells.Length; i++) {
                    if (tableItemStyle.IsSet(TableItemStyle.PROP_HORZALIGN)) {
                        _innerCells[i].HorizontalAlign = tableItemStyle.HorizontalAlign;
                    }

                    if (tableItemStyle.IsSet(TableItemStyle.PROP_VERTALIGN)) {
                        _innerCells[i].VerticalAlign = tableItemStyle.VerticalAlign;
                    }
                }
            }