mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-13 03:35:04 +00:00
Exposing method to remove all registered services
This commit is contained in:
@@ -157,6 +157,15 @@ namespace ICD.Common.Utils.Services
|
||||
return Instance.TryAddServiceInstance(tService, service);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all of the registered services.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public static void RemoveAllServices()
|
||||
{
|
||||
Instance.RemoveAllServicesInstance();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to remove the given service from every registered type.
|
||||
/// </summary>
|
||||
@@ -347,6 +356,14 @@ namespace ICD.Common.Utils.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all of the registered services.
|
||||
/// </summary>
|
||||
private void RemoveAllServicesInstance()
|
||||
{
|
||||
m_ServicesSection.Execute(() => m_Services.Clear());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the given service from all registered types.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user