public async Task LoadDocumentSettingsOnChangeAsync(ConfigurationLevels level, string snapshotId)
        {
            _logger.LogInformation($"Configuration change detected... Level: {level}, Document: {snapshotId}");
            //Remove all keys for a new load.
            ConfigData.Clear();
            //When a change is made in one level we must load all other levels in order to merge all settings ordered by relevance (application -> stage -> machine).
            foreach (var configurationLevel in _connectionManager.GetConfigurationDocumentLevels())
            {
                _logger.LogDebug($"Loading Documents by Level. Current:{configurationLevel}");
                var remoteSettingsDocument = await _connectionManager.GetDocumentFieldsAsync(configurationLevel);

                if (remoteSettingsDocument.Count > 0)
                {
                    //Use this FirestoreConfigurationProvider method to convert the json settings into a dictionary with IConfiguration format.
                    var dataDictionary = JsonSettingsToDictionarySettings(remoteSettingsDocument.ToJson());
                    //Add settings to a centralized final dictionary.
                    dataDictionary.ToList().ForEach(item => ConfigData.AddOrUpdate(item.Key.ToLower(), item.Value, (key, value) => value = item.Value));
                    //Resolve configuration secrets if exists.
                    var secretValues = await _secretsManager.ResolveSecretsAsync(dataDictionary, _options.ProjectId);

                    secretValues.ForEach(item => ConfigData.AddOrUpdate(item.Key.ToLower(), item.Value, (key, value) => value = item.Value));
                }
            }
            //Use this FirestoreConfigurationProvider method in order to have access the private Data Dictionary and refresh the token.
            ReloadSettings(ConfigData);
            _logger.LogDebug($"End of detected change load! {DateTime.Now}");
        }
Beispiel #2
0
 public Loopback()
 {
     ConfigData.Clear();
     ConfigData.Set("Connect Message", "Hello, World.");
     ConfigData.Set("Disconnect Message", "Disconnected.", new string[] { "Test", "Kilroy was here", "The future is now", "Compile Your Reality" });
     ConfigData.Set("Checkbox", true);
     ConfigData.Set("Number", 123);
 }
Beispiel #3
0
        public override void OnCreate()
        {
            base.OnCreate();
            Data.Clear();
            ConfigData.Clear();
            int step = Squar / CellCount;

            PosIndex = new Vector2[RealCount, RealCount];
            for (int i = 0; i < RealCount; ++i)
            {
                for (int j = 0; j < RealCount; ++j)
                {
                    PosIndex[i, j] = new Vector2((i + 1) * step, (j + 1) * step);
                }
            }
            OnAddWeather();
        }
Beispiel #4
0
    void Clear()
    {
        if (mWorkbook != null)
        {
            mWorkbook.Close(false, false, Missing.Value);
        }
        mWorksheet = null;
        mWorkbook  = null;

        if (mExcelApp != null)
        {
            mExcelApp.Quit();
        }
        mExcelApp = null;

        mAllData = null;
        mConfigData.Clear();
    }
Beispiel #5
0
 public TCP()
 {
     ConfigData.Clear();
     ConfigData.Set("Remote Host", "host.server.com");
     ConfigData.Set("Port", 23);
 }