public void CopyTo(SmtpAccount targetAccount)
        {
            var data = Data.CreateDataStorage();

            StoreValues(data, "");
            targetAccount.ReadValues(data, "");
        }
Esempio n. 2
0
        public void ReadValues(Data data, string path)
        {
            try
            {
                int numClasses = int.Parse(data.GetValue(@"" + path + @"DropboxAccounts\numClasses"));
                for (int i = 0; i < numClasses; i++)
                {
                    DropboxAccount tmp = new DropboxAccount();
                    tmp.ReadValues(data, @"" + path + @"DropboxAccounts\" + i + @"\");
                    DropboxAccounts.Add(tmp);
                }
            } catch {}


            try
            {
                int numClasses = int.Parse(data.GetValue(@"" + path + @"FtpAccounts\numClasses"));
                for (int i = 0; i < numClasses; i++)
                {
                    FtpAccount tmp = new FtpAccount();
                    tmp.ReadValues(data, @"" + path + @"FtpAccounts\" + i + @"\");
                    FtpAccounts.Add(tmp);
                }
            } catch {}


            try
            {
                int numClasses = int.Parse(data.GetValue(@"" + path + @"HttpAccounts\numClasses"));
                for (int i = 0; i < numClasses; i++)
                {
                    HttpAccount tmp = new HttpAccount();
                    tmp.ReadValues(data, @"" + path + @"HttpAccounts\" + i + @"\");
                    HttpAccounts.Add(tmp);
                }
            } catch {}


            try
            {
                int numClasses = int.Parse(data.GetValue(@"" + path + @"SmtpAccounts\numClasses"));
                for (int i = 0; i < numClasses; i++)
                {
                    SmtpAccount tmp = new SmtpAccount();
                    tmp.ReadValues(data, @"" + path + @"SmtpAccounts\" + i + @"\");
                    SmtpAccounts.Add(tmp);
                }
            } catch {}


            try
            {
                int numClasses = int.Parse(data.GetValue(@"" + path + @"TimeServerAccounts\numClasses"));
                for (int i = 0; i < numClasses; i++)
                {
                    TimeServerAccount tmp = new TimeServerAccount();
                    tmp.ReadValues(data, @"" + path + @"TimeServerAccounts\" + i + @"\");
                    TimeServerAccounts.Add(tmp);
                }
            } catch {}
        }