コード例 #1
0
    public void Select (TSelectionItem item)
    {
      for (int index = 0; index < ItemsSource.Count; index++) {
        var selectionItem = ItemsSource [index];

        if (selectionItem.Contains (item)) {
          SelectedIndex = index;
          break;
        }
      }
    }
コード例 #2
0
    public void SelectModel (TEntityAction action)
    {
      if (action.NotNull ()) {
        var name = action.SupportAction.SelectionInfo.Name;
        var tag = action.SupportAction.SelectionInfo.Tag;
        var image = action.SupportAction.SelectionInfo.GetImage ();
        var enabled = action.SupportAction.SelectionInfo.Enabled;

        if (enabled) {
          var selection = TSelectionItem.Create (name, tag, image, enabled);

          Select (selection);
        }
      }
    }
コード例 #3
0
    public bool Contains (TSelectionItem alias)
    {
      if (alias.NotNull ()) {
        // Tag
        if (string.IsNullOrEmpty (alias.ValueString)) {
          return (Tag.Equals (alias.Tag));
        }

        // ValueString
        if (alias.Tag.IsNull ()) {
          return (ValueString.Equals (alias.ValueString, StringComparison.InvariantCulture));
        }

        // both
        return (ValueString.Equals (alias.ValueString, StringComparison.InvariantCulture) && Tag.Equals (alias.Tag));
      }

      return (false);
    }
コード例 #4
0
    public void Select (TEntityAction action)
    {
      ItemsSource.Clear ();
      m_SelectionAllCollection.Clear ();

      if (action.NotNull ()) {
        foreach (var item in action.SupportAction.SelectionCollection) {
          if (item.Enabled) {
            var selectionItem = TSelectionItem.Create (item.Name, item.Tag, item.GetImage (), item.Enabled);

            ItemsSource.Add (selectionItem);

            m_SelectionAllCollection.Add (selectionItem);
          }
        }
      }

      if (ItemsSource.Any ()) {
        SelectedIndex = 0;
      }
    }