No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SelectableItemContent.cs 975B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace UnityEditor.TestTools.TestRunner.GUI.Controls
  3. {
  4. /// <summary>
  5. /// A default implementation of the <see cref="ISelectableItem{T}" /> interface.
  6. /// </summary>
  7. /// <typeparam name="T">The type of the value represented by this content element.</typeparam>
  8. internal class SelectableItemContent<T> : ISelectableItem<T>
  9. {
  10. private readonly string m_DisplayName;
  11. /// <summary>
  12. /// Creates a new instance of the <see cref="SelectableItemContent{T}" /> class
  13. /// </summary>
  14. /// <param name="itemValue">The value represented by this item.</param>
  15. /// <param name="displayName">The display name of this item.</param>
  16. public SelectableItemContent(T itemValue, string displayName)
  17. {
  18. Value = itemValue;
  19. m_DisplayName = displayName;
  20. }
  21. public T Value { get; }
  22. public string DisplayName => m_DisplayName ?? string.Empty;
  23. }
  24. }