public bool GetOpenLinks() { var query = _db.GetCollection <Settings>("Settings").FindOne(s => s.Setting == "Open Links"); SettingEvent?.Invoke(query, SettingEnum.Refresh); return(query.OpenLinks); }
public int GetRefreshTime() { var query = _db.GetCollection <Settings>("Settings").FindOne(s => s.Setting == "Refresh Time"); SettingEvent?.Invoke(query, SettingEnum.Refresh); return(query.Active); }
public Settings GetSettingsFor(string setting) { var query = _db.GetCollection <Settings>("Settings").FindOne(s => s.Setting == setting); SettingEvent?.Invoke(query, SettingEnum.Get); return(query); }
public List <Settings> GetAllSettings() { var query = _db.GetCollection <Settings>("Settings").FindAll().ToList(); SettingEvent?.Invoke(query, SettingEnum.Get); return(query); }
public void SaveSettings(List <Settings> settings) { var query = _db.GetCollection <Settings>("Settings"); using (var trans1 = _db.BeginTrans()) { query.Update(settings); trans1.Commit(); } SettingEvent?.Invoke(settings, SettingEnum.Update); }