private void DocumentChangeObserver_Changed(object sender, DocumentChangeEventArgs e)
        {
            if (e.Document.CollectionNamespace.CollectionName != CollectionHelper.GetName <BlogSettings>())
            {
                return;
            }

            Thread.Sleep(_source.ReloadDelay);
            Load();
        }
Пример #2
0
 /// <summary>
 /// Let the DocumentChangeObserver know an document has changed.
 /// </summary>
 /// <param name="e">Event arguments for events relating to tracked MongoDB.Driver.ChangeStreamDocuments.</param>
 public void OnChanged(DocumentChangeEventArgs e)
 {
     ThreadPool.QueueUserWorkItem((_) => Changed?.Invoke(this, e));
 }