Пример #1
0
        private void ReadConfig()
        {
            string xmlInputData = string.Empty;

            try
            {
                xmlInputData = File.ReadAllText(AWSConfiguration);
                Env          = Serializer.Deserialize <AWSEnvionment>(xmlInputData);
            }
            catch (ArgumentException ex)
            {
                Log.Add($"AWSConfig ArgumentException Error {ex}");
            }
            catch (DirectoryNotFoundException ex)
            {
                Log.Add($"AWSConfig DirectoryNotFoundException Error {ex}");
                throw;
            }
        }
Пример #2
0
        private Result ReadConfig()
        {
            string xmlInputData = string.Empty;

            try
            {
                xmlInputData = File.ReadAllText(SensorsConfigFile);
                SensorInfo sensors = Serializer.Deserialize <SensorInfo>(xmlInputData);
                System.Console.WriteLine(sensors.Sensors.Count());
                return(Result.Ok());
            }
            catch (ArgumentException ex)
            {
                Log.Add($"AWSConfig ArgumentException Error {ex}");
                return(Result.Fail($"AWSConfig ArgumentException Error {ex}"));
            }
            catch (DirectoryNotFoundException ex)
            {
                return(Result.Fail($"AWSConfig ArgumentException Error {ex}"));
            }
        }