예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddMvc();
     services.AddIdentityServer()
     .AddDeveloperSigningCredential()
     .AddInMemoryPersistedGrants()
     .AddInMemoryIdentityResources(ScopeConfiguration.GetIdentityResources())
     .AddInMemoryApiResources(ApiConfiguration.Get())
     .AddInMemoryClients(ClientConfiguration.Get())
     .AddTestUsers(UserConfiguration.Get());
 }
예제 #3
0
        public void ClientsFinishSlotClick()
        {
            if (GridModel.SelectedSlot == null)
            {
                return;
            }

            if (ClientConfiguration.Get(GridModel.SelectedSlot.Settings.Name) is IFahClient client)
            {
                client.Finish(GridModel.SelectedSlot.SlotID);
            }
        }
예제 #4
0
        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);
        }
예제 #5
0
        // 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());
        }