Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 4973964

Browse files
committed
Clean up the mef provider dispatcher (C# 6 ftw)
1 parent 1c561dd commit 4973964

File tree

1 file changed

+12
-46
lines changed

1 file changed

+12
-46
lines changed

src/GitHub.VisualStudio/Services/UIProvider.cs

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public GitHubProviderDispatcher([Import(typeof(SVsServiceProvider))] IServicePro
3939
theRealProvider = serviceProvider.GetService(typeof(IUIProvider)) as IUIProvider;
4040
}
4141

42-
public ExportProvider ExportProvider { get { return theRealProvider.ExportProvider; } }
42+
public ExportProvider ExportProvider => theRealProvider.ExportProvider;
4343

4444
public IServiceProvider GitServiceProvider
4545
{
@@ -54,60 +54,26 @@ public IServiceProvider GitServiceProvider
5454
}
5555
}
5656

57-
public void AddService(Type t, object owner, object instance)
58-
{
59-
theRealProvider.AddService(t, owner, instance);
60-
}
57+
public void AddService(Type t, object owner, object instance) => theRealProvider.AddService(t, owner, instance);
6158

62-
public void AddService<T>(object owner, T instance)
63-
{
64-
theRealProvider.AddService<T>(owner, instance);
65-
}
59+
public void AddService<T>(object owner, T instance) => theRealProvider.AddService<T>(owner, instance);
6660

67-
public object GetService(Type serviceType)
68-
{
69-
return theRealProvider.GetService(serviceType);
70-
}
61+
public object GetService(Type serviceType) => theRealProvider.GetService(serviceType);
7162

72-
public IObservable<bool> ListenToCompletionState()
73-
{
74-
return theRealProvider.ListenToCompletionState();
75-
}
76-
77-
public void RemoveService(Type t, object owner)
78-
{
79-
theRealProvider.RemoveService(t, owner);
80-
}
63+
public IObservable<bool> ListenToCompletionState() => theRealProvider.ListenToCompletionState();
8164

82-
public void RunUI()
83-
{
84-
theRealProvider.RunUI();
85-
}
65+
public void RemoveService(Type t, object owner) => theRealProvider.RemoveService(t, owner);
8666

87-
public void RunUI(UIControllerFlow controllerFlow, IConnection connection)
88-
{
89-
theRealProvider.RunUI(controllerFlow, connection);
90-
}
67+
public void RunUI() => theRealProvider.RunUI();
9168

92-
public IObservable<LoadData> SetupUI(UIControllerFlow controllerFlow, IConnection connection)
93-
{
94-
return theRealProvider.SetupUI(controllerFlow, connection);
95-
}
69+
public void RunUI(UIControllerFlow controllerFlow, IConnection connection) => theRealProvider.RunUI(controllerFlow, connection);
9670

97-
public object TryGetService(string typename)
98-
{
99-
return theRealProvider.TryGetService(typename);
100-
}
71+
public IObservable<LoadData> SetupUI(UIControllerFlow controllerFlow, IConnection connection) => theRealProvider.SetupUI(controllerFlow, connection);
72+
public object TryGetService(string typename) => theRealProvider.TryGetService(typename);
10173

102-
public object TryGetService(Type t)
103-
{
104-
return theRealProvider.TryGetService(t);
105-
}
74+
public object TryGetService(Type t) => theRealProvider.TryGetService(t);
10675

107-
public T TryGetService<T>() where T : class
108-
{
109-
return theRealProvider.TryGetService<T>();
110-
}
76+
public T TryGetService<T>() where T : class => theRealProvider.TryGetService<T>();
11177
}
11278

11379
/// <summary>

0 commit comments

Comments
 (0)