public override void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
 {
     base.AddAttributesToRender(writer, owner);
     if (!this.Wrap)
     {
         if (this.IsControlEnableLegacyRendering(owner))
         {
             writer.AddAttribute(HtmlTextWriterAttribute.Nowrap, "nowrap");
         }
         else
         {
             writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
         }
     }
     System.Web.UI.WebControls.HorizontalAlign horizontalAlign = this.HorizontalAlign;
     if (horizontalAlign != System.Web.UI.WebControls.HorizontalAlign.NotSet)
     {
         TypeConverter converter = TypeDescriptor.GetConverter(typeof(System.Web.UI.WebControls.HorizontalAlign));
         writer.AddAttribute(HtmlTextWriterAttribute.Align, converter.ConvertToString(horizontalAlign).ToLower(CultureInfo.InvariantCulture));
     }
     System.Web.UI.WebControls.VerticalAlign verticalAlign = this.VerticalAlign;
     if (verticalAlign != System.Web.UI.WebControls.VerticalAlign.NotSet)
     {
         TypeConverter converter2 = TypeDescriptor.GetConverter(typeof(System.Web.UI.WebControls.VerticalAlign));
         writer.AddAttribute(HtmlTextWriterAttribute.Valign, converter2.ConvertToString(verticalAlign).ToLower(CultureInfo.InvariantCulture));
     }
 }
Пример #2
0
        public CVerticalAlign(System.Web.UI.WebControls.VerticalAlign webVerticalAlign)
        {
            switch (webVerticalAlign)
            {
            case System.Web.UI.WebControls.VerticalAlign.NotSet:
                _value = VerticalAlign.Top;
                break;

            default:
                _value = (VerticalAlign)((int)webVerticalAlign - 1);
                break;
            }
        }