Beispiel #1
0
    public TImagePositionItem (TStyleInfo styleHorizontalInfo, TStyleInfo styleVerticalInfo, TImagePosition imagePosition)
      : this ()
    {
      Position = imagePosition;

      if (imagePosition.Equals (TImagePosition.None).IsFalse ())  {
        if (styleHorizontalInfo.NotNull () && styleVerticalInfo.NotNull ()) {
          var width = TContentStyle.RequestStyleSize (styleHorizontalInfo.StyleMode, styleHorizontalInfo.Style);
          var height = TContentStyle.RequestStyleSize (styleVerticalInfo.StyleMode, styleVerticalInfo.Style);

          switch (Position) {
            case TImagePosition.Left:
            case TImagePosition.Right:
              Size.Width = (int) (width * .4); // 40%
              Size.Height = height;
              break;

            case TImagePosition.Top:
            case TImagePosition.Bottom:
              Size.Width = width;
              Size.Height = (int) (height * .4); // 40%
              break;

            case TImagePosition.Full:
              Size.Width = width;
              Size.Height = height;
              break;
          }
        }
      }
    }
Beispiel #2
0
    public void Select (TContentStyle.Mode styleMode, string styleString)
    {
      switch (styleMode) {
        case TContentStyle.Mode.Horizontal:
          StyleHorizontal.Select (styleString);
          break;

        case TContentStyle.Mode.Vertical:
          StyleVertical.Select (styleString);
          break;
      }

      Size.SelectColumns (TContentStyle.RequestBoardStyleSize (StyleHorizontal.Style));
      Size.SelectRows (TContentStyle.RequestBoardStyleSize (StyleVertical.Style));
    }
Beispiel #3
0
    public TStylePropertyItem (TContentStyle.Mode styleMode, TContentStyle.Style style)
      : this ()
    {
      StyleInfo = TStyleInfo.Create (styleMode);
      StyleInfo.Select (style);

      var size = TContentStyle.RequestStyleSize (styleMode, style);

      switch (styleMode) {
        case TContentStyle.Mode.Horizontal:
          Size.Width = size;
          break;

        case TContentStyle.Mode.Vertical:
          Size.Height = size;
          break;
      }
    }
Beispiel #4
0
        public void Select(string styleString)
        {
            var style = TContentStyle.TryToParse(styleString);

            Select(style);
        }