protected override void OnServerStarted() { base.OnServerStarted(); _defaultSmtpServer = OtherSettings.GetValue(AlertRule.MailHost, "mailhost"); _defaultMailFrom = OtherSettings.GetValue(AlertRule.MailFrom, AlertRule.UserDefaultReplyTo); _defaultMailTo = OtherSettings.GetArray(AlertRule.MailTo, new[] { AlertRule.GroupDefaultMailTo }); }
private void StartUp() { // default configuration EnvId env = IntClient.Target.ClientInfo.ConfigEnv; // derived configuration _serverPort = OtherSettings.GetValue(WFPropName.Port, EnvHelper.SvcPort(env, SvcId.GridSwitch)); _nodeId = OtherSettings.GetValue(WFPropName.NodeId, Guid.NewGuid()); // create router/worker worksteps Routers = GridWorksteps.Create().ToArray(); Workers = GridWorksteps.Create().ToArray(); // start discovery endpoint string endpoint = ServiceHelper.FormatEndpoint(WcfConst.NetTcp, _serverPort); string svcName = EnvHelper.SvcPrefix(SvcId.GridSwitch); _discoServerHost = new CustomServiceHost <IDiscoverV111, DiscoverRecverV111>( Logger, new DiscoverRecverV111(this), endpoint, svcName, typeof(IDiscoverV111).Name, true); IWorkContext context = new WorkContext(Logger, IntClient.Target, HostInstance, ServerInstance); // start gridswitch endpoints - routers before workers foreach (IWorkstep router in Routers) { router.Initialise(context); router.EnableGrid(GridLevel.Router, _nodeId, _serverPort, null); } foreach (IWorkstep worker in Workers) { worker.Initialise(context); worker.EnableGrid(GridLevel.Worker, _nodeId, _serverPort, null); } }
public SettingView GetAllSetting() { InfoSettings infoSettings = new InfoSettings(); DefaultSettings generalSettings = new DefaultSettings(); MailSettings mailSettings = new MailSettings(); OtherSettings otherSettings = new OtherSettings(); infoSettings = GetInfoSettings(); generalSettings = GetDefaultSettings(); mailSettings = GetMailSettings(); otherSettings = GetOthersSettings(); var settingView = new SettingView(); settingView.InfoSettingView = new InfoSettingView(); var config = new MapperConfiguration(cfg => cfg.CreateMap <InfoSettings, InfoSettingView>()); var mapper = config.CreateMapper(); settingView.InfoSettingView = mapper.Map <InfoSettingView>(infoSettings); settingView.SystemSettingView = new SystemSettingView(); config = new MapperConfiguration(cfg => cfg.CreateMap <DefaultSettings, SystemSettingView>()); mapper = config.CreateMapper(); settingView.SystemSettingView = mapper.Map <SystemSettingView>(generalSettings); settingView.MailSettingView = new MailSettingView(); config = new MapperConfiguration(cfg => cfg.CreateMap <MailSettings, MailSettingView>()); mapper = config.CreateMapper(); settingView.MailSettingView = mapper.Map <MailSettingView>(mailSettings); settingView.OthersSettingView = new OthersSettingView(); config = new MapperConfiguration(cfg => cfg.CreateMap <OtherSettings, OthersSettingView>()); mapper = config.CreateMapper(); settingView.OthersSettingView = mapper.Map <OthersSettingView>(otherSettings); return(settingView); }
public Base(SpellsSettings spellSetting, TimeSettings timeSetting, OtherSettings otherSetting,short evadeMode, bool useEvade,bool useEvadeSkills) { SpellSetting = spellSetting; TimeSetting = timeSetting; OtherSetting = otherSetting; EvadeMode = evadeMode; UseEvade = useEvade; UseEvadeSkills = useEvadeSkills; }
public bool SetOthersSetting(SettingView viewModel) { OtherSettings otherSettings = new OtherSettings(); var config = new MapperConfiguration(cfg => cfg.CreateMap <OthersSettingView, OtherSettings>()); var mapper = config.CreateMapper(); otherSettings = mapper.Map <OtherSettings>(viewModel.OthersSettingView); if (!ValidationDictionary.IsValid()) { return(false); } SetGroupSetting(SettingTypes.Other, otherSettings); Save(); return(true); }
private void GetUserDefinedImageName() { try { OtherSettings otherSettings = new OtherSettings(); string name = otherSettings.GetUserDefinedName(); if (!string.IsNullOrEmpty(name)) { DefaultExportImageName = name; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SaveChanges(string getName) { try { OtherSettings settings = new OtherSettings(); settings.SetImageName(getName); var result = settings.SaveChanges(); if (result != null) { CallDelegateToUpdate(result); MessageBox.Show("Saved successfully : " + result.GetImageName(), "Updated Name ", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, ILogger log, ExecutionContext context) { log.LogInformation("C# HTTP trigger function processed a request."); //Configuration Settings var config = new ConfigurationBuilder() .SetBasePath(context.FunctionAppDirectory) .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .Build(); //Access local.settings.json file var otherSettings = new OtherSettings(); config.Bind("OtherSettings", otherSettings); return(new OkObjectResult(otherSettings.MyData)); }
public bool?WriteOther(string other, [FromBody] OtherSettings settings) { // Prepare to update var update = VCRConfiguration.Current.BeginUpdate ( SettingNames.SuppressDelayAfterForcedHibernation, SettingNames.DisablePCRFromMPEG2Generation, SettingNames.DisablePCRFromH264Generation, SettingNames.DelayAfterForcedHibernation, SettingNames.UseStandByForHibernation, SettingNames.MayHibernateSystem, SettingNames.HibernationDelay, SettingNames.ArchiveLifeTime, SettingNames.LoggingLevel, SettingNames.LogLifeTime, SettingNames.AllowBasic, SettingNames.TCPPort, SettingNames.SSLPort, SettingNames.UseSSL ); // Change update[SettingNames.SuppressDelayAfterForcedHibernation].NewValue = settings.SuppressDelayAfterForcedHibernation.ToString(); update[SettingNames.DelayAfterForcedHibernation].NewValue = settings.DelayAfterForcedHibernation.ToString(); update[SettingNames.DisablePCRFromMPEG2Generation].NewValue = settings.DisablePCRFromMPEG2.ToString(); update[SettingNames.DisablePCRFromH264Generation].NewValue = settings.DisablePCRFromH264.ToString(); update[SettingNames.UseStandByForHibernation].NewValue = settings.UseStandBy.ToString(); update[SettingNames.HibernationDelay].NewValue = settings.HibernationDelay.ToString(); update[SettingNames.MayHibernateSystem].NewValue = settings.AllowHibernate.ToString(); update[SettingNames.ArchiveLifeTime].NewValue = settings.ArchiveTime.ToString(); update[SettingNames.LogLifeTime].NewValue = settings.ProtocolTime.ToString(); update[SettingNames.AllowBasic].NewValue = settings.AllowBasic.ToString(); update[SettingNames.LoggingLevel].NewValue = settings.Logging.ToString(); update[SettingNames.SSLPort].NewValue = settings.SSLPort.ToString(); update[SettingNames.TCPPort].NewValue = settings.WebPort.ToString(); update[SettingNames.UseSSL].NewValue = settings.UseSSL.ToString(); // Process return(ServerRuntime.Update(update.Values)); }
public void Save() { var sb = new StringBuilder(); var allsettings = OtherSettings.Concat( Enumerable.Repeat( new KeyValuePair <string, string>(Key4InputMeasurements, _inputMeasKeysString), 1)); foreach (var kv in allsettings) { sb.Append(kv.Key).Append("="); if (kv.Value.Contains(';')) { sb.Append("{").Append(kv.Value).Append("}"); } else { sb.Append(kv.Value); } sb.Append(";"); } _config.AppSettings.Settings[Key4VsmConfig].Value = sb.ToString(); _config.Save(); }
public BootableLaunchProfile(ILaunchProfile profile) { Name = profile.Name; CommandName = profile.CommandName; ExecutablePath = profile.ExecutablePath; CommandLineArgs = profile.CommandLineArgs; WorkingDirectory = profile.WorkingDirectory; LaunchBrowser = profile.LaunchBrowser; LaunchUrl = profile.LaunchUrl; EnvironmentVariables = profile.EnvironmentVariables; OtherSettings = profile.OtherSettings; if (OtherSettings.TryGetValue(DebugModeProperty, out var debugModeObj) && debugModeObj is string debugMode) { DebugMode = debugMode; } if (OtherSettings.TryGetValue(HostProperty, out var hostNameObj) && hostNameObj is string hostName) { HostProvider = hostName; } }
public HomeController(IHostingEnvironment hostingEnvironment, IOptions <OtherSettings> otherSettings) { _hostingEnvironment = hostingEnvironment; _otherSettings = otherSettings.Value; }
void WriteTo(OtherSettings other) { other.UseMemoryMappedIO = this.UseMemoryMappedIO; other.DeserializeResources = this.DeserializeResources; }
private void UpdateUI(OtherSettings other) { textBox_ImageNames.Text = other.GetImageName(); }
private void CallDelegateToUpdate(OtherSettings other) { delUpdateUi delUpdateUi = new delUpdateUi(UpdateUI); textBox_ImageNames.BeginInvoke(delUpdateUi, other); }
public XmlConverter(IOptionsMonitor <OtherSettings> optionsMonitor) { _options = optionsMonitor.CurrentValue; }
protected override void OnServerStarted() { // default configuration _activeProviders = new[] { MDSProviderId.Bloomberg }; // custom configuration string[] enabledProviders = OtherSettings.GetArray <string>(MdsPropName.EnabledProviders); if (enabledProviders != null && enabledProviders.Length > 0) { _activeProviders = enabledProviders.Select(providerName => EnumHelper.Parse <MDSProviderId>(providerName, true)).ToArray(); } // derived configuration EnvId envId = IntClient.Target.ClientInfo.ConfigEnv; string envName = EnvHelper.EnvName(envId); var port = OtherSettings.GetValue(MdsPropName.Port, EnvHelper.SvcPort(envId, SvcId.MarketData)); // service endpoints string transEndpoints = ServiceHelper.FormatEndpoint(WcfConst.NetTcp, port); string discoEndpoints = ServiceHelper.FormatEndpoint(WcfConst.NetTcp, port); transEndpoints = OtherSettings.GetValue(MdsPropName.Endpoints, transEndpoints); // add default port to endpoints if required var tempEndpoints = new List <string>(); foreach (string ep in transEndpoints.Split(';')) { var epParts = ep.Split(':'); var scheme = epParts[0]; var tport = port; if (epParts.Length > 1) { tport = Int32.Parse(epParts[1]); } tempEndpoints.Add($"{scheme}:{tport}"); } transEndpoints = String.Join(";", tempEndpoints.ToArray()); // get user identity and full name WindowsIdentity winIdent = WindowsIdentity.GetCurrent(); UserPrincipal principal = null; try { var principalContext = new PrincipalContext(ContextType.Domain); principal = UserPrincipal.FindByIdentity(principalContext, IdentityType.SamAccountName, winIdent.Name); } catch (PrincipalException principalException) { // swallow - can occur on machines not connected to domain controller Logger.LogWarning("UserPrincipal.FindByIdentity failed: {0}: {1}", principalException.GetType().Name, principalException.Message); } string userFullName = null; if (principal != null) { userFullName = principal.GivenName + " " + principal.Surname; } _serverCfg = new ServerCfg( new ModuleInfo(envName, Guid.NewGuid(), winIdent.Name, userFullName, null, null), transEndpoints, discoEndpoints); foreach (MDSProviderId providerId in _activeProviders) { _providers[(int)providerId] = new MarketDataRealtimeClient(LoggerRef, MainThreadQueue, IntClient.Target, providerId); } string svcName = EnvHelper.SvcPrefix(SvcId.MarketData); // V2.2 _mrktDataV221ServerHost = new CustomServiceHost <IMrktDataV221, MrktDataRecverV221>( Logger, new MrktDataRecverV221(this), _serverCfg.TransEndpoints, svcName, typeof(IMrktDataV221).Name, true); _sessCtrlV131ServerHost = new CustomServiceHost <ISessCtrlV131, SessCtrlRecverV131>( Logger, new SessCtrlRecverV131(this), _serverCfg.DiscoEndpoints, svcName, typeof(ISessCtrlV131).Name, true); _discoServerHostV111 = new CustomServiceHost <IDiscoverV111, DiscoverRecverV111>( Logger, new DiscoverRecverV111(this), _serverCfg.DiscoEndpoints, svcName, typeof(IDiscoverV111).Name, true); }