コード例 #1
0
 private void ReloadSettings()
 {
     this.Settings = this.settingsCollection.FindOne();
     if (this.Settings == null)
     {
         this.Settings = CollectionSettings.CreateDefault();
         this.SaveSettings();
     }
 }
コード例 #2
0
        private void ReloadSettings()
        {
            using (var reader = this.loadSettings.ExecuteReader())
            {
                while (reader.Read())
                {
                    this.Settings = this.Deserialize <CollectionSettings>(reader.GetBytes("bson"));
                    return;
                }
            }

            if (this.Settings == null)
            {
                this.Settings = CollectionSettings.CreateDefault();
                this.SaveSettings();
            }
        }