Esempio n. 1
0
        /// <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
        }
Esempio n. 2
0
        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 + "]"));
                }
            }
        }
Esempio n. 3
0
 /// <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);
 }
Esempio n. 4
0
 public static void SaveContacts()
 {
     PABXFile <Dictionary <string, UserContactData> > .SaveObject("contacts.json", UserContacts);
 }
Esempio n. 5
0
 public static void SaveCallData()
 {
     PABXFile <List <UserCallData> > .SaveObject("recent.json", UserCalls);
 }
Esempio n. 6
0
 public static void SaveSmartLinks()
 {
     PABXFile <SmartLinkSettings> .SaveObject("smartlink.bbsconf", SmartLinkConfig);
 }