From 3fb889ab7aa3cb0dfae23e0379e28552e919ad72 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 6 Jun 2020 15:49:09 -0700 Subject: Integrate change to TryParseCommand and other code cleanup --- src/WixToolset.Core/WixToolsetServiceProvider.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/WixToolset.Core/WixToolsetServiceProvider.cs') diff --git a/src/WixToolset.Core/WixToolsetServiceProvider.cs b/src/WixToolset.Core/WixToolsetServiceProvider.cs index 2cd097a4..1d475d00 100644 --- a/src/WixToolset.Core/WixToolsetServiceProvider.cs +++ b/src/WixToolset.Core/WixToolsetServiceProvider.cs @@ -96,8 +96,7 @@ namespace WixToolset.Core return service != null; } - public bool TryGetService(out T service) - where T : class + public bool TryGetService(out T service) where T : class { var success = this.TryGetService(typeof(T), out var untypedService); service = (T)untypedService; @@ -109,8 +108,7 @@ namespace WixToolset.Core return this.TryGetService(serviceType, out var service) ? service : throw new ArgumentException($"Unknown service type: {serviceType.Name}", nameof(serviceType)); } - public T GetService() - where T : class + public T GetService() where T : class { return (T)this.GetService(typeof(T)); } @@ -120,14 +118,12 @@ namespace WixToolset.Core this.CreationFunctions[serviceType] = creationFunction; } - public void AddService(Func, T> creationFunction) - where T : class + public void AddService(Func, T> creationFunction) where T : class { this.AddService(typeof(T), creationFunction); } - private static T AddSingleton(Dictionary singletons, T service) - where T : class + private static T AddSingleton(Dictionary singletons, T service) where T : class { singletons.Add(typeof(T), service); return service; -- cgit v1.2.3-55-g6feb