/// <summary> /// Raises the Startup event that is fired when an application is starting. This event is raised by the OnStartup method. /// </summary> /// <param name="sender">Object that raises the event.</param> /// <param name="e">Event argument.</param> private void App_Startup(object sender, StartupEventArgs e) { var builder = new ContainerBuilder(); builder.Register(p => GitHubClientSettings.CreateInstance()).As <IGitHubClientSettings>().InstancePerLifetimeScope(); builder.RegisterType <GitHubClientHelper>().As <IGitHubClientHelper>().InstancePerLifetimeScope(); builder.RegisterType <ConverterService>().As <IConverterService>().InstancePerLifetimeScope(); var container = builder.Build(); var csl = new AutofacServiceLocator(container); ServiceLocator.SetLocatorProvider(() => csl); Current.MainWindow = new MainWindow(ServiceLocator.Current.GetInstance <IConverterService>()); Current.MainWindow.Show(); }
public GitHubAuthController(GitHubClientSettings settings, Func <IGitHubClient> clientFactory) { _settings = settings; _clientFactory = clientFactory; }
public void Init() { this._settings = GitHubClientSettings.CreateInstance(); this._helper = new Services.GitHubClientHelper(this._settings); this._converter = new ConverterService(this._helper); }