Пример #1
0
        protected async Task LoadSettingsAsync()
        {
            List<Exception> exceptions = new List<Exception>();

            try
            {
                Settings = (await FileIO.ReadTextAsync(await GetSettingsFile())).ConvertJsonTo<Settings>();
            }
            catch (Exception ex)
            {
                exceptions.Add(ex);
            }

            if (Settings == null)
            {
                try
                {
                    Settings = new Settings();
                }
                catch (Exception ex)
                {
                    exceptions.Add(ex);
                }
            }

            if (Settings != null)
            {
                GetCredentials();
                Settings.PropertyChanged += Settings_PropertyChanged;
            }
        }
Пример #2
0
        internal LedLightService(Settings settings, BuildService buildService)
        {
            Settings = settings;
            Telemetry = new TelemetryClient();
            BuildService = buildService;

            Initialise();
        }