Ejemplo n.º 1
0
    public bool Select (TContentStyle.Style selectedStyle)
    {
      bool res = false;

      if (m_SelectedStyle.Equals (selectedStyle).IsFalse ()) {
        m_SelectedStyle = selectedStyle;
        res = true;
      }

      return (res);
    }
Ejemplo n.º 2
0
        public static int RequestStyleSize(TContentStyle.Mode mode, TContentStyle.Style style)
        {
            int size = 0;

            switch (mode)
            {
            case Mode.Horizontal:
                size = m_HorizontalSizeStyles [style];
                break;

            case Mode.Vertical:
                size = m_VerticalSizeStyles [style];
                break;
            }

            return(size);
        }
Ejemplo n.º 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;
      }
    }
Ejemplo n.º 4
0
    public void Select (TContentStyle.Style selectedStyleHorizontal, TContentStyle.Style selectedStyleVertical)
    {
      var list = new List<TComponentModelItem> ();

      if (ComponentModelCollection.Count > 0) {
        list = ComponentModelCollection
          .Where (p => p.StyleHorizontal.Equals (selectedStyleHorizontal.ToString (), StringComparison.InvariantCulture))
          .Where (p => p.StyleVertical.Equals (selectedStyleVertical.ToString (), StringComparison.InvariantCulture))
          .ToList ()
        ;

        // zap drop model
        foreach (var item in m_ComponentModelDrop) {
          var dropList = list
            .Where (p => p.Id.Equals (item.Key))
            .ToList ()
          ;

          if (dropList.Count.Equals (1)) {
            var model = dropList [0];
            list.Remove (model);
          }
        }
      }

      // try to insert
      foreach (var tryToInsertModel in m_ComponentModelTryToInsert) {
        var itemModel = tryToInsertModel.Value;

        if (itemModel.ContainsStyle (selectedStyleHorizontal, selectedStyleVertical)) {
          list.Add (itemModel);
        }
      }

      ItemsCollection = new ObservableCollection<TComponentModelItem> (list);
    }
Ejemplo n.º 5
0
 public static string RequestStyleSizeString(TContentStyle.Mode mode, TContentStyle.Style style)
 {
     return(RequestStyleSize(mode, style).ToString(CultureInfo.InvariantCulture));
 }
Ejemplo n.º 6
0
 public static int RequestBoardStyleSize(TContentStyle.Style style)
 {
     return(m_BoardStyleSize.ContainsKey(style) ? m_BoardStyleSize [style] : 0);
 }
Ejemplo n.º 7
0
 public bool ContainsStyle (TContentStyle.Style styleHorizontal, TContentStyle.Style styleVertical)
 {
   return (StyleHorizontal.Equals (styleHorizontal.ToString (), StringComparison.InvariantCulture) && StyleVertical.Equals (styleVertical.ToString (), StringComparison.InvariantCulture));
 }
Ejemplo n.º 8
0
 public void Select(TContentStyle.Style style)
 {
     Style = style;
 }
Ejemplo n.º 9
0
 public T Request (TContentStyle.Style style)
 {
   return (m_Styles [style]);
 }