private void ReadDoIBoundaries(Configuration config, ConfigDoI doi) { doi.MinX = TryParseDouble(config, "DoI-MinX", Double.MinValue); doi.MaxX = TryParseDouble(config, "DoI-MaxX", Double.MaxValue); doi.MinY = TryParseDouble(config, "DoI-MinY", Double.MinValue); doi.MaxY = TryParseDouble(config, "DoI-MaxY", Double.MaxValue); }
private void LoadConfig() { string scalabilityConfigPath = this.GetType().Assembly.Location; Configuration config = ConfigurationManager.OpenExeConfiguration(scalabilityConfigPath); doi = new ConfigDoI(); ReadDoIBoundaries(config, doi); ReadDoIComponents(config, doi); ServerSync.LocalServer.DoI = doi; dor = new ConfigDoR(); ReadDoRBoundaries(config, dor); ServerSync.LocalServer.DoR = dor; }
private static void ReadDoIComponents(Configuration config, ConfigDoI doi) { var doiComponents = config.AppSettings.Settings["DoI-Components"]; if (doiComponents != null) { List<string> parsedDoIComponents = new List<string>(doiComponents.Value.Split(',')); parsedDoIComponents = parsedDoIComponents.FindAll(c => c.Length > 0); // A single asterisk means all components are fine. if (parsedDoIComponents.Count == 1 && parsedDoIComponents[0] == "*") return; doi.RelevantComponents = parsedDoIComponents; } }
private static void ReadDoIComponents(Configuration config, ConfigDoI doi) { var doiComponents = config.AppSettings.Settings["DoI-Components"]; if (doiComponents != null) { List <string> parsedDoIComponents = new List <string>(doiComponents.Value.Split(',')); parsedDoIComponents = parsedDoIComponents.FindAll(c => c.Length > 0); // A single asterisk means all components are fine. if (parsedDoIComponents.Count == 1 && parsedDoIComponents[0] == "*") { return; } doi.RelevantComponents = parsedDoIComponents; } }