Example #1
0
 public async static void LoadSmartLinks()
 {
     if (PABXFile <SmartLinkSettings> .Exists("smartlink.bbsconf"))
     {
         SmartLinkConfig = await PABXFile <SmartLinkSettings> .LoadObjectAsync("smartlink.bbsconf");
     }
 }
Example #2
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
        }
Example #3
0
        public static async void LoadContacts()
        {
            UserContacts = await PABXFile <Dictionary <string, UserContactData> > .LoadObjectAsync("contacts.json");

            DebuggingTools.VarDump(UserContacts);
            if (UserContacts == null)
            {
                UserContacts = new Dictionary <string, UserContactData>();
            }
        }
Example #4
0
 public static async void LoadCalls()
 {
     if (File.Exists("recent.json"))
     {
         UserCalls = await PABXFile <List <UserCallData> > .LoadObjectAsync("recent.json");
     }
     else
     {
         UserCalls = new List <UserCallData>();
     }
 }
Example #5
0
        public static async void LoadSettings()
        {
            Settings = await PABXFile <Dictionary <string, SettingsStore> > .LoadObjectAsync("config.bbs") ?? new Dictionary <string, SettingsStore>();

            if (!Settings.ContainsKey(CurrentUser.login.ToString()))
            {
                Settings[CurrentUser.login.ToString()] = new SettingsStore();
            }
#if DEBUG
            Settings.Dump();
#endif
        }
Example #6
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 + "]"));
                }
            }
        }
Example #7
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);
 }
Example #8
0
 public static void SaveContacts()
 {
     PABXFile <Dictionary <string, UserContactData> > .SaveObject("contacts.json", UserContacts);
 }
Example #9
0
 public static void SaveCallData()
 {
     PABXFile <List <UserCallData> > .SaveObject("recent.json", UserCalls);
 }
Example #10
0
 public static LoginCredentials LoadCreds()
 {
     return(PABXFile <LoginCredentials> .LoadObjectAsync("login_details.json").Result != null ? PABXFile <LoginCredentials> .LoadObjectAsync("login_details.json").Result : new LoginCredentials());
 }
Example #11
0
 public static void SaveSmartLinks()
 {
     PABXFile <SmartLinkSettings> .SaveObject("smartlink.bbsconf", SmartLinkConfig);
 }