/// /// Copyright © 2003-2008 JetBrains s.r.o. /// You may distribute under the terms of the GNU General Public License, as published by the Free Software Foundation, version 2 (see License.txt in the repository root folder). /// using System; namespace JetBrains.Omea.OpenApiEx { /// /// An interface for the list of resource objects, accessibly by index, Resource ID, and name. /// /// The resource object type. public interface IResourceObjectsListByName : IResourceObjectsList where T : class, IResourceObject { /// /// Gets a resource object by its name. /// Throws if there is no such resource in the list. /// If there's more than one, returns any (undefined behavior). /// /// Name of the resource to look up. /// The resource object. T GetByName(string name); /// /// Gets a resource object by its name. /// Returns Null there is no such resource in the list. /// If there's more than one, returns any (undefined behavior). /// /// Name of the resource to look up. /// The resource object, or Null if not found. T TryGetByName(string name); /// /// Gets a resource object by its name, same as . /// Throws if there is no such resource in the list. /// If there's more than one, returns any (undefined behavior). /// /// Name of the resource to look up. /// The resource object. T this[string name] { get; } /// /// Gets the list of all the resources with such a name in the collection. /// If there are none such found, returns an empty list. /// /// Name of the resources to look up. /// The list of matching resources. IResourceObjectsList GetAllByName(string name); /// /// Creates a new item and adds it to the list. /// May be unsupported by a particular list, in which case a will be thrown. /// /// The name for the new object. /// The newly-created object. T Create(string name); } }