コード例 #1
0
        /// <summary>
        /// Create an instance of the WatchedConfigurationSource, add listeners, and wait for the update callbacks.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="ignoreDeletesFromSource"></param>
        /// <param name="updater"></param>
        public DynamicWatchedConfiguration(IWatchedConfigurationSource source, bool ignoreDeletesFromSource,
                                           DynamicPropertyUpdater updater)
        {
            m_Source = source;
            IgnoreDeletesFromSource = ignoreDeletesFromSource;
            m_Updater = updater;

            // Get a current snapshot of the config source data
            try
            {
                var currentData = source.GetCurrentData();
                var result      = WatchedUpdateResult.CreateFull(currentData);
                UpdateConfiguration(result);
            }
            catch (Exception ex)
            {
                m_Log.Error("Could not GetCurrentData() from the WatchedConfigurationSource", ex);
            }

            // Add a listener for subsequent config updates
            m_Source.ConfigurationUpdated += Source_ConfigurationUpdated;
        }
コード例 #2
0
 public void SetUp()
 {
     m_DynamicPropertyUpdater = new DynamicPropertyUpdater();
 }