/// <summary> /// Searches the list of registered <see cref="IManager"/> instances for the specified instance and returns a value /// indicating whether it was found. /// </summary> /// <typeparam name="T">The Manager Type to check.</typeparam> /// <returns>A value indicating whether the specified Manager has been registered.</returns> private bool IsManagerRegistered <T>() where T : IManager { return(ManagerInstances.OfType <T>().Count() > 0); }
/// <summary> /// Returns the Manager from the list of Managers matching the specified Type. /// </summary> /// <typeparam name="T">The Type of the Manager to return.</typeparam> /// <returns>The requested Manager.</returns> public T GetManager <T>() where T : IManager { return(ManagerInstances.OfType <T>().FirstOrDefault()); }