Promptu Launcher - Rocket Your Productivity

Home Help Feedback About Download

ValueList

ZachJohnson.Promptu.UserModel.ValueList exposes the functionality of the corresponding Value List in the UI to .NET functions. It provides a list of values and (optionally) translation values to provide as suggestions for command and function parameters, with a finer grain of control over translation values than its UI counterpart.

Constructors

  • public ValueList()
    Initializes a new instance of the ValueList class, with no namespace interpretation and no item translation.

  • public ValueList(bool useNamespaceInterpretation, bool useItemTranslations)
    Initializes a new instance of the ValueList class, using the specified values for using namespace interpretation and item translation.
    If useNamespaceInterpretation is true, Promptu will interpret dots '.' in the values as namespace separators.

Properties

  • public int Count { get; }
    Returns the number of items in the ValueList.

  • public List<Image> Images { get; }
    Gets the list of images to use when displaying the ValueList's items.

  • public ValueListItem this[int index] { get; }
    Gets the ValueListItem at the specified index.

    Exceptions:
    System.ArgumentOutOfRangeException: index is less than 0 or greater than or equal to Count.

  • public ValueListItem this[string value] { get; }
    Gets the ValueListItem with the specified value, case-insensitive.

    Exceptions:
    System.ArgumentNullException: value is null.

  • public bool UseItemTranslations { get; }
    Gets a value indicating whether the ValueList uses item translation.

  • public bool UseNamespaceInterpretation { get; }
    Gets a value indicating whether the ValueList uses namespace interpretation.

Static Methods

  • public static ValueList FromXml(XmlNode node)
    Constructs a ValueList from its XML form.

    Exceptions:
    System.ArgumentNullException: node is null.
    ZachJohnson.Promptu.LoadException: The 'name' attribute is either empty or missing from the node.

Methods

  • public void Add(ValueListItem valueListItem)
    Adds the specified ValueListItem to the ValueList.

    Exceptions:
    System.ArgumentNullException: valueListItem is null.
    System.ArgumentException: valueListItem.Value is already present in the ValueList.

  • public void Clear()
    Clears all items from the ValueList.

  • public void Clone()
    Returns an exact copy of the ValueList.

  • public bool ContainsValue(string value)
    Does a case-insensitive lookup to determine if the specified value is in the ValueList.

    Exceptions:
    System.ArgumentNullException: value is null.

  • public int IndexOf(string value)
    Returns the index of the specified value if it is in the ValueList, otherwise, -1.

    Exceptions:
    System.ArgumentNullException: value is null.

  • public bool Remove(string value)
    Removes the specified value from the ValueList.

    Exceptions:
    System.ArgumentNullException: value is null.

  • public bool RemoveAt(int index)
    Removes the item at the specified index.

    Exceptions:
    System.ArgumentOutOfRangeException: index is less than 0 or greater than or equal to Count.

  • public void Sort()
    Sorts the ValueList.

  • public XmlNode ToXml(string name, XmlDocument document)
    Converts the ValueList into its XML form, creating an XmlNode with the specified name using the specified XmlDocument.

    Exceptions:
    System.ArgumentNullException: name is null or document is null.

  • public ValueListItem TryGet(string value, out bool found)
    Tries to get the ValueListItem with the specified value. The boolean found indicates whether the item was found.

    Exceptions:
    System.ArgumentNullException: value is null.