1- using System ;
1+ using System ;
22using System . Globalization ;
33using System . Linq ;
44using System . Net ;
1717
1818namespace GitHub . Api
1919{
20- public class ApiClient : IApiClient
20+ public partial class ApiClient : IApiClient
2121 {
2222 static readonly Logger log = LogManager . GetCurrentClassLogger ( ) ;
2323
2424 const string ProductName = Info . ApplicationInfo . ApplicationDescription ;
25- const string clientId = "" ;
26- const string clientSecret = "" ;
2725
2826 readonly IObservableGitHubClient gitHubClient ;
2927 // There are two sets of authorization scopes, old and new:
@@ -34,12 +32,18 @@ public class ApiClient : IApiClient
3432 readonly static Lazy < string > lazyNote = new Lazy < string > ( ( ) => ProductName + " on " + GetMachineNameSafe ( ) ) ;
3533 readonly static Lazy < string > lazyFingerprint = new Lazy < string > ( GetFingerprint ) ;
3634
35+ string ClientId { get ; set ; }
36+ string ClientSecret { get ; set ; }
37+
3738 public ApiClient ( HostAddress hostAddress , IObservableGitHubClient gitHubClient )
3839 {
40+ Configure ( ) ;
3941 HostAddress = hostAddress ;
4042 this . gitHubClient = gitHubClient ;
4143 }
4244
45+ partial void Configure ( ) ;
46+
4347 public IObservable < Repository > CreateRepository ( NewRepository repository , string login , bool isUser )
4448 {
4549 Guard . ArgumentNotEmptyString ( login , "login" ) ;
@@ -76,14 +80,14 @@ public IObservable<ApplicationAuthorization> GetOrCreateApplicationAuthenticatio
7680
7781 return string . IsNullOrEmpty ( authenticationCode )
7882 ? authorizationsClient . CreateAndDeleteExistingApplicationAuthorization (
79- clientId ,
80- clientSecret ,
83+ ClientId ,
84+ ClientSecret ,
8185 newAuthorization ,
8286 dispatchedHandler ,
8387 true )
8488 : authorizationsClient . CreateAndDeleteExistingApplicationAuthorization (
85- clientId ,
86- clientSecret ,
89+ ClientId ,
90+ ClientSecret ,
8791 newAuthorization ,
8892 dispatchedHandler ,
8993 authenticationCode ,
@@ -116,7 +120,7 @@ public IObservable<LicenseMetadata> GetLicenses()
116120 return gitHubClient . Miscellaneous . GetAllLicenses ( ) ;
117121 }
118122
119- public HostAddress HostAddress { get ; private set ; }
123+ public HostAddress HostAddress { get ; }
120124
121125 public ITwoFactorChallengeHandler TwoFactorChallengeHandler { get ; private set ; }
122126
0 commit comments