Esempio n. 1
0
        private static (int memorySize, int iterations, int parametersLength) GetParameterValues(string memorySize, string iterations)
        {
            // Get the number of bytes to skip when reading
            int parametersLength = GetParametersLength(memorySize, iterations);

            // Get parameter values - remove file flags (e.g. |m=value)
            memorySize = RemoveParameterFlag(memorySize);
            iterations = RemoveParameterFlag(iterations);
            return(Invariant.ToInt(memorySize), Invariant.ToInt(iterations), parametersLength);
        }
Esempio n. 2
0
 private static int?LoadIntegerSetting(string setting)
 {
     try
     {
         return(Invariant.ToInt(setting));
     }
     catch (Exception ex) when(ExceptionFilters.SettingsExceptions(ex))
     {
         Logging.LogException(ex.ToString(), Logging.Severity.Low);
         DisplayMessage.Error(ex.GetType().Name, $"Unable to convert {setting} setting to integer.");
         return(null);
     }
 }