public void ClientsEditClick(FahClientSettingsPresenterFactory presenterFactory) { var selectedSlot = GridModel.SelectedSlot; if (selectedSlot == null) { return; } var client = ClientConfiguration.Get(selectedSlot.Settings.Name); var originalSettings = client.Settings; Debug.Assert(originalSettings.ClientType == ClientType.FahClient); var model = new FahClientSettingsModel(originalSettings); using (var dialog = presenterFactory.Create(model)) { while (dialog.ShowDialog(Form) == DialogResult.OK) { var newSettings = dialog.Model.ClientSettings; // perform the edit try { ClientConfiguration.Edit(originalSettings.Name, newSettings); break; } catch (ArgumentException ex) { Logger.Error(ex.Message, ex); MessageBox.ShowError(Form, ex.Message, Core.Application.NameAndVersion); } } } }
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddIdentityServer() .AddDeveloperSigningCredential() .AddInMemoryPersistedGrants() .AddInMemoryIdentityResources(ScopeConfiguration.GetIdentityResources()) .AddInMemoryApiResources(ApiConfiguration.Get()) .AddInMemoryClients(ClientConfiguration.Get()) .AddTestUsers(UserConfiguration.Get()); }
public void ClientsFinishSlotClick() { if (GridModel.SelectedSlot == null) { return; } if (ClientConfiguration.Get(GridModel.SelectedSlot.Settings.Name) is IFahClient client) { client.Finish(GridModel.SelectedSlot.SlotID); } }
public void ClientsRefreshSelectedClick() { // Check for SelectedSlot, and get out if not found if (GridModel.SelectedSlot == null) { return; } var client = ClientConfiguration.Get(GridModel.SelectedSlot.Settings.Name); Task.Run(client.Retrieve); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddIdentityServer(options => { // Set the lifetime of the authentication cookie to 5 seconds options.Authentication.CookieLifetime = TimeSpan.FromSeconds(5); }) .AddDeveloperSigningCredential() .AddInMemoryClients(ClientConfiguration.Get()) .AddInMemoryIdentityResources(IdentityResourceConfiguration.Get()) .AddInMemoryApiResources(ApiResourceConfiguration.Get()) .AddTestUsers(TestUserConfiguration.Get()); }