public void RunView(ClientViewerControl view) { // view.ServerSecure = false; if (ServerState.Instance.ServerService != null && ServerState.Instance.ServerService.Settings != null) { view.ServerSecure = ServerState.Instance.ServerService.Settings.Secure; } EventBroker.Instance.Subscribe <ApplyServerSettingsEventArgs>(OnUpdateServerSettings); EventBroker.Instance.Subscribe <CancelServerSettingsEventArgs>(OnCancelServerSettings); EventBroker.Instance.Subscribe <ServerSettingsSecureChangedEventArgs>(OnServerSettingsSecureChanged); // store the view _view = view; _view.SettingsChanged += new EventHandler(View_SettingsChanged); _view_LoadClients(_view, EventArgs.Empty); _view.LoadClients += new EventHandler <EventArgs>(_view_LoadClients); #if LEADTOOLS_V20_OR_LATER IOptionsDataAccessAgent optionsAgent = DataAccessServices.GetDataAccessService <IOptionsDataAccessAgent>(); if (optionsAgent != null) { ClientConfigurationOptions clientConfigurationOptions = optionsAgent.Get <ClientConfigurationOptions>(ClientConfigurationOptionsKeyName, new ClientConfigurationOptions()); if (clientConfigurationOptions != null) { _view.Options = clientConfigurationOptions; } } #endif // #if LEADTOOLS_V20_OR_LATER }
public CreateNewEventValidator(ClientConfigurationOptions options) { _options = options; RuleFor(x => x.EventName).NotEmpty(); RuleFor(x => x.EventFilename).Must(FilenameIsUnique).WithMessage("'Event Filename' must be unqiue"); }
public UpdateExistingTalkAsAdminValidator(ClientConfigurationOptions options) { _options = options; RuleFor(x => x.TalkTitle).NotEmpty(); RuleFor(x => x.TalkSummary).NotEmpty(); RuleFor(x => x.TalkBodyMarkdown).NotEmpty().WithMessage("'Talk Abstract' must not be empty"); /*RuleFor(x => x.IsApproved).Must(TalkIsSubmitted).WithMessage("Talk must be submitted before approval");*/ }
public UpdateExistingNewsValidator(ClientConfigurationOptions options) { _options = options; RuleFor(x => x.Title).NotEmpty(); RuleFor(x => x.Filename).NotEmpty(); RuleFor(x => x.Filename).Must(FilenameIsUnique).WithMessage("'News Filename' must be unqiue"); }
public RegisterNewUserValidator(ClientConfigurationOptions options) { _options = options; RuleFor(x => x.EmailAddress).Must(BeAnEmailAddress).WithMessage("'Email address' must be a valid email address"); RuleFor(x => x.EmailAddress).Must(BeAUniqueEmailAddress).WithMessage("'Email address' is already in use"); RuleFor(x => x.Password).Must(BeASensiblePassword).WithMessage( $"'Password' must be at least {PasswordLength} characters long with at least one uppercase letter and one number"); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerfactory, IApplicationLifetime appLifetime, ClientConfigurationOptions configurationOptions) { loggerfactory.AddSerilog(); var forwardedHeadersOptions = new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }; forwardedHeadersOptions.KnownProxies.Clear(); forwardedHeadersOptions.KnownNetworks.Clear(); app.UseForwardedHeaders(forwardedHeadersOptions); app.UseStaticFiles(); app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationScheme = "Cookies", }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions { AuthenticationScheme = "oidc", SignInScheme = "Cookies", Authority = configurationOptions.IdentityServer.AuthorityServer, RequireHttpsMetadata = false, ClientId = "mvc", SaveTokens = true, Scope = { "roles" }, GetClaimsFromUserInfoEndpoint = true }); /*app.UseMetrics();*/ app.UseMvc(routes => { routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); routes.MapRoute("page", "page/{*filename}", new { controller = "Page", action = "Index" }); }); appLifetime.ApplicationStopped.Register(Log.CloseAndFlush); }
public Handler(UpdateExistingEventValidator validator, ClientConfigurationOptions options) { _validator = validator; _options = options; }
public UpsertSpeakerProfileQuery(ClientConfigurationOptions options) { _options = options; }
public QueryEventById(ClientConfigurationOptions options) { _options = options; }
public SendEmailConfirmation(ClientConfigurationOptions options) { _options = options; }
public Handler(CreateNewEventValidator validator, ClientConfigurationOptions options) { _validator = validator; _options = options; }
public CreateNewRegisteredUser(ClientConfigurationOptions options) { _options = options; }
public Handler(ClientConfigurationOptions options, CreatePageValidation validation) { _options = options; _validation = validation; }
public Handler(ClientConfigurationOptions options, VolunteerRegistrationValidation validator) { _options = options; _validator = validator; }
public Handler(ClientConfigurationOptions options) { _options = options; }
public Handler(CreateNewsValidation validation, ClientConfigurationOptions options) { _validation = validation; _options = options; }
public Handler(AddNewTalkValidator validator, ClientConfigurationOptions options) { _validator = validator; _options = options; }
void OnUpdateServerSettings(object sender, EventArgs e) { if (_view != null) { IAeManagementDataAccessAgent agent = DataAccessServices.GetDataAccessService <IAeManagementDataAccessAgent>(); IPermissionManagementDataAccessAgent permissionsAgent = DataAccessServices.GetDataAccessService <IPermissionManagementDataAccessAgent>(); #if LEADTOOLS_V20_OR_LATER IOptionsDataAccessAgent optionsAgent = DataAccessServices.GetDataAccessService <IOptionsDataAccessAgent>(); if (optionsAgent != null) { ClientConfigurationOptions clientConfigurationOptions = optionsAgent.Get <ClientConfigurationOptions>(ClientConfigurationOptionsKeyName, new ClientConfigurationOptions()); if (clientConfigurationOptions != null) { View.Options = clientConfigurationOptions; } } #endif // #if LEADTOOLS_V20_OR_LATER AeInfoExtended[] aeInfoExtendedArray = agent.GetAeTitles(); List <string> aeTitlesInDB = new List <string>(); foreach (AeInfoExtended ae in aeInfoExtendedArray) { ClientInformation info = (from i in ServerState.Instance.ClientList.Items where i.Client.AETitle == ae.AETitle select i).FirstOrDefault(); // // Only add items that existed when the database was first queried. If an ae title was added outside of this dialog // it will be ignored. // if (info != null) { aeTitlesInDB.Add(ae.AETitle.ToUpper()); } } // Updates and adds foreach (ClientInformation ci in _view.ClientInformationList.Items) { string aeTitle = ci.Client.AETitle; if (aeTitlesInDB.Contains(aeTitle, StringComparer.InvariantCultureIgnoreCase)) { // update ClientInformation ciPrevious = null; ServerState.Instance.ClientList.ClientDictionary.TryGetValue(aeTitle, out ciPrevious); if (!ciPrevious.Equals(ci)) { agent.Update(aeTitle, ci.Client); } aeTitlesInDB.Remove(aeTitle.ToUpper()); try { EventBroker.Instance.PublishEvent <ClientUpdatedEventArgs>(this, new ClientUpdatedEventArgs(aeTitle, ci.Client)); } catch { } } else { // insert agent.Add(ci.Client); try { EventBroker.Instance.PublishEvent <ClientAddedEventArgs>(this, new ClientAddedEventArgs(ci.Client)); } catch { } } permissionsAgent.DeleteUserPermission(null, aeTitle); foreach (string permissionName in ci.Permissions) { permissionsAgent.AddUserPermission(permissionName, aeTitle); } } // Finally, remove the deleted AE titles from the database foreach (string aeTitle in aeTitlesInDB) { agent.Remove(aeTitle); try { EventBroker.Instance.PublishEvent <ClientRemovedEventArgs>(this, new ClientRemovedEventArgs(aeTitle)); } catch { } } ServerState.Instance.ClientList = new ClientInformationList(_view.ClientInformationList); } }
public QueryLiveNewsById(ClientConfigurationOptions options) { _options = options; }
public Handler(UpsertSpeakerProfileValidator validator, UpsertSpeakerProfileQuery upsertSpeakerProfileQuery, ClientConfigurationOptions options) { _validator = validator; _upsertSpeakerProfileQuery = upsertSpeakerProfileQuery; _options = options; }