11using System ;
22using EnvDTE ;
33using EnvDTE80 ;
4+ using GitHub . Extensions ;
5+ using GitHub . Info ;
6+ using GitHub . Primitives ;
47using GitHub . Services ;
58using LibGit2Sharp ;
69using Microsoft . VisualStudio ;
710using Microsoft . VisualStudio . ComponentModelHost ;
811using Microsoft . VisualStudio . Shell . Interop ;
9- using GitHub . Info ;
10- using GitHub . Primitives ;
11- using GitHub . Extensions ;
1212
1313namespace GitHub . VisualStudio
1414{
15-
1615 public static class Services
1716 {
1817 public static IServiceProvider PackageServiceProvider { get ; set ; }
@@ -37,20 +36,14 @@ static Ret GetGlobalService<T, Ret>(IServiceProvider provider = null) where T :
3736 return PackageServiceProvider . GetService ( typeof ( T ) ) as Ret ;
3837 }
3938
40- public static IComponentModel ComponentModel
41- {
42- get { return GetGlobalService < SComponentModel , IComponentModel > ( ) ; }
43- }
39+ public static IComponentModel ComponentModel => GetGlobalService < SComponentModel , IComponentModel > ( ) ;
4440
4541 public static IVsWebBrowsingService GetWebBrowsingService ( this IServiceProvider provider )
4642 {
4743 return GetGlobalService < SVsWebBrowsingService , IVsWebBrowsingService > ( provider ) ;
4844 }
4945
50- public static IVsOutputWindow OutputWindow
51- {
52- get { return GetGlobalService < SVsOutputWindow , IVsOutputWindow > ( ) ; }
53- }
46+ public static IVsOutputWindow OutputWindow => GetGlobalService < SVsOutputWindow , IVsOutputWindow > ( ) ;
5447
5548 static IVsOutputWindowPane outputWindowPane = null ;
5649 public static IVsOutputWindowPane OutputWindowPane
@@ -62,14 +55,14 @@ public static IVsOutputWindowPane OutputWindowPane
6255 // First make sure the output window is visible
6356 var uiShell = GetGlobalService < SVsUIShell , IVsUIShell > ( ) ;
6457 // Get the frame of the output window
65- Guid outputWindowGuid = new Guid ( "{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}" ) ;
58+ var outputWindowGuid = new Guid ( "{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}" ) ;
6659 IVsWindowFrame outputWindowFrame = null ;
6760 ErrorHandler . ThrowOnFailure ( uiShell . FindToolWindow ( ( uint ) __VSCREATETOOLWIN . CTW_fForceCreate , ref outputWindowGuid , out outputWindowFrame ) ) ;
6861 // Show the output window
6962 if ( outputWindowFrame != null )
7063 ErrorHandler . ThrowOnFailure ( outputWindowFrame . Show ( ) ) ;
7164
72- Guid paneGuid = new Guid ( "E37A42B1-C1AE-475C-9982-7F49FE61918D" ) ;
65+ var paneGuid = new Guid ( "E37A42B1-C1AE-475C-9982-7F49FE61918D" ) ;
7366 ErrorHandler . ThrowOnFailure ( OutputWindow . CreatePane ( ref paneGuid , ApplicationInfo . ApplicationSafeName , 1 /*visible=true*/ , 0 /*clearWithSolution=false*/ ) ) ;
7467 ErrorHandler . ThrowOnFailure ( OutputWindow . GetPane ( ref paneGuid , out outputWindowPane ) ) ;
7568 }
@@ -78,15 +71,9 @@ public static IVsOutputWindowPane OutputWindowPane
7871 }
7972 }
8073
81- public static DTE Dte
82- {
83- get { return GetGlobalService < DTE , DTE > ( ) ; }
84- }
74+ public static DTE Dte => GetGlobalService < DTE , DTE > ( ) ;
8575
86- public static DTE2 Dte2
87- {
88- get { return Dte as DTE2 ; }
89- }
76+ public static DTE2 Dte2 => Dte as DTE2 ;
9077
9178 public static IVsActivityLog GetActivityLog ( this IServiceProvider provider )
9279 {
@@ -130,6 +117,6 @@ static UriString GetUri(IRepository repo)
130117 {
131118 return UriString . ToUriString ( GitService . GetUriFromRepository ( repo ) ? . ToRepositoryUrl ( ) ) ;
132119 }
133- public static IGitService IGitService { get { return PackageServiceProvider . GetService < IGitService > ( ) ; } }
120+ public static IGitService IGitService => PackageServiceProvider . GetService < IGitService > ( ) ;
134121 }
135122}
0 commit comments