/// <summary> /// Save the settings object to a .bbs file /// </summary> public static void SaveSettings() { PABXFile <Dictionary <string, SettingsStore> > .SaveObject("config.bbs", Settings); #if DEBUG Settings.Dump(); #endif }
public async static void SaveCreds(LoginCredentials creds) { string credString = JsonConvert.SerializeObject(creds); if (creds.remember == true) { if (File.Exists("login_details.bbs")) //If the file exists { var auth = await PABXFile <List <LoginCredentials> > .LoadObjectAsync("login_details.bbs"); bool exists = false; foreach (LoginCredentials a in auth) { if (a.login == creds.login) { exists = true; } } if (exists == false) //Only add the login if it doesn't already exist { auth.Add(creds); } List <LoginCredentials> l = new List <LoginCredentials>(); foreach (var value in auth.OrderBy(i => i.login)) //Order the list of users numerically { l.Add(value); } PABXFile <List <LoginCredentials> > .SaveObject("login_details.bbs", l); } else //If the file doesn't exist create it and write everything to it { File.WriteAllText("login_details.bbs", BBSEncrypt("[" + credString + "]")); } } }
/// <summary> /// Save Extension Groups to the default file /// </summary> public static void SaveGroups() { UserExtensionGroupData[CurrentUser.ami_login] = CurrentUserGroups; PABXFile <Dictionary <string, List <ExtensionGroup> > > .SaveObject("groups.json", UserExtensionGroupData); }
public static void SaveContacts() { PABXFile <Dictionary <string, UserContactData> > .SaveObject("contacts.json", UserContacts); }
public static void SaveCallData() { PABXFile <List <UserCallData> > .SaveObject("recent.json", UserCalls); }
public static void SaveSmartLinks() { PABXFile <SmartLinkSettings> .SaveObject("smartlink.bbsconf", SmartLinkConfig); }