public CreateAccountPageModel(ISocketService socketService, ILoginCache loginCache) { this.socketService = socketService; this.loginCache = loginCache; credentials = LoadCredentials(); }
public RepositoryHostFactory( IApiClientFactory apiClientFactory, IHostCacheFactory hostCacheFactory, ILoginCache loginCache, IAvatarProvider avatarProvider, ITwoFactorChallengeHandler twoFactorChallengeHandler) { this.apiClientFactory = apiClientFactory; this.hostCacheFactory = hostCacheFactory; this.loginCache = loginCache; this.avatarProvider = avatarProvider; this.twoFactorChallengeHandler = twoFactorChallengeHandler; }
//监控服务的变化 void CustomerContext_ServiceChanged(object sender, ServiceEventArgs e) { if (CustomerContext != null && e.ServiceType == "SystemService.IAccountService.ILoginCache") { if (e.ServiceEventType == ServiceEventType.Add) { LoginCache = CustomerContext.GetFirstOrDefaultService <SystemService.IAccountService.ILoginCache>(); } if (e.ServiceEventType == ServiceEventType.Remove) { LoginCache = null; } } }
public RepositoryHost( IApiClient apiClient, IModelService modelService, ILoginCache loginCache, ITwoFactorChallengeHandler twoFactorChallengeHandler) { ApiClient = apiClient; ModelService = modelService; this.loginCache = loginCache; this.twoFactorChallengeHandler = twoFactorChallengeHandler; Debug.Assert(apiClient.HostAddress != null, "HostAddress of an api client shouldn't be null"); Address = apiClient.HostAddress; hostAddress = apiClient.HostAddress; isEnterprise = !hostAddress.IsGitHubDotCom(); Title = apiClient.HostAddress.Title; }
/// <summary> /// Initializes a new instance of the <see cref="LoginManager"/> class. /// </summary> /// <param name="loginCache">The cache in which to store login details.</param> /// <param name="twoFactorChallengeHandler">The handler for 2FA challenges.</param> /// <param name="clientId">The application's client API ID.</param> /// <param name="clientSecret">The application's client API secret.</param> /// <param name="authorizationNote">An note to store with the authorization.</param> /// <param name="fingerprint">The machine fingerprint.</param> public LoginManager( ILoginCache loginCache, ITwoFactorChallengeHandler twoFactorChallengeHandler, string clientId, string clientSecret, string authorizationNote = null, string fingerprint = null) { Guard.ArgumentNotNull(loginCache, nameof(loginCache)); Guard.ArgumentNotNull(twoFactorChallengeHandler, nameof(twoFactorChallengeHandler)); Guard.ArgumentNotEmptyString(clientId, nameof(clientId)); Guard.ArgumentNotEmptyString(clientSecret, nameof(clientSecret)); this.loginCache = loginCache; this.twoFactorChallengeHandler = twoFactorChallengeHandler; this.clientId = clientId; this.clientSecret = clientSecret; this.authorizationNote = authorizationNote; this.fingerprint = fingerprint; }
public void Start(IBundleContext context) { //加载账号服务 if (context != null) { //第一步:保存插件上下文 CustomerContext = context; //第二步:获取账号服务(检查当前模块是否在合法菜单内) LoginCache = CustomerContext.GetFirstOrDefaultService <SystemService.IAccountService.ILoginCache>(); //第三步:监听系统账号服务 CustomerContext.ServiceChanged += CustomerContext_ServiceChanged; } //加载字典 //Application firstOrDefaultService = context.GetFirstOrDefaultService<Application>(); //if (firstOrDefaultService != null) //{ // try // { // firstOrDefaultService.Resources = new ResourceDictionary // { // MergedDictionaries = // { // new ResourceDictionary // { // Source = new Uri("/FirstFloor.ModernUI,Version=1.0.9.0;component/Assets/ModernUI.xaml", UriKind.RelativeOrAbsolute) // }, // new ResourceDictionary // { // Source = new Uri("/FirstFloor.ModernUI,Version=1.0.9.0;component/Assets/ModernUI.Light.xaml", UriKind.RelativeOrAbsolute) // } // } // }; // } // catch // { // } //} }
public GitHubCredentialStore(HostAddress hostAddress, ILoginCache loginCache) { this.hostAddress = hostAddress; this.loginCache = loginCache; }
public ApiClientFactory(ILoginCache loginCache, IProgram program, ILoggingConfiguration config) { LoginCache = loginCache; productHeader = program.ProductHeader; config.Configure(); }