Пример #1
0
 public BackgroundPosition(string value, CultureInfo culture)
 {
     this._type = BackgroundPositionType.NotSet;
     this._value = System.Web.UI.WebControls.Unit.Empty;
     if ((value != null) && (value.Length != 0))
     {
         string str = value.ToLower();
         if ((str.Equals("top") || str.Equals("left")) || str.Equals("toporleft"))
         {
             this._type = BackgroundPositionType.TopOrLeft;
         }
         else if (str.Equals("center"))
         {
             this._type = BackgroundPositionType.Center;
         }
         else if ((str.Equals("bottom") || str.Equals("right")) || str.Equals("bottomorright"))
         {
             this._type = BackgroundPositionType.BottomOrRight;
         }
         else
         {
             this._value = System.Web.UI.WebControls.Unit.Parse(value, culture);
             this._type = BackgroundPositionType.Unit;
         }
     }
 }
Пример #2
0
 public BackgroundPosition(System.Web.UI.WebControls.Unit value)
 {
     this._type = BackgroundPositionType.NotSet;
     if (!value.IsEmpty)
     {
         this._type = BackgroundPositionType.Unit;
         this._value = value;
     }
     else
     {
         this._value = System.Web.UI.WebControls.Unit.Empty;
     }
 }
Пример #3
0
 public BackgroundPosition(BackgroundPositionType type)
 {
     if ((type < BackgroundPositionType.NotSet) || (type > BackgroundPositionType.BottomOrRight))
     {
         throw new ArgumentOutOfRangeException("type");
     }
     this._type = type;
     if (type == BackgroundPositionType.Unit)
     {
         this._value = System.Web.UI.WebControls.Unit.Pixel(0);
     }
     else
     {
         this._value = System.Web.UI.WebControls.Unit.Empty;
     }
 }