Exemplo n.º 1
0
        public DropboxAccount Copy()
        {
            DropboxAccount copy = new DropboxAccount();

            copy.AccessToken = AccessToken;
            copy.AccountId   = AccountId;
            copy.AccountInfo = AccountInfo;
            return(copy);
        }
Exemplo n.º 2
0
 public void StoreValues(Data data, string path)
 {
     for (int i = 0; i < DropboxAccounts.Count; i++)
     {
         DropboxAccount tmp = DropboxAccounts[i];
         tmp.StoreValues(data, @"" + path + @"DropboxAccounts\" + i + @"\");
     }
     data.SetValue(@"" + path + @"DropboxAccounts\numClasses", DropboxAccounts.Count.ToString());
 }
Exemplo n.º 3
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 {}
 }
Exemplo n.º 4
0
        public void ReplaceWith(DropboxAccount source)
        {
            AccessToken = source.AccessToken;
            if (AccountId != source.AccountId)
            {
                AccountId = source.AccountId;
            }

            if (AccountInfo != source.AccountInfo)
            {
                AccountInfo = source.AccountInfo;
            }
        }
Exemplo n.º 5
0
        public void StoreValues(Data data, string path)
        {
            for (int i = 0; i < DropboxAccounts.Count; i++)
            {
                DropboxAccount tmp = DropboxAccounts[i];
                tmp.StoreValues(data, @"" + path + @"DropboxAccounts\" + i + @"\");
            }
            data.SetValue(@"" + path + @"DropboxAccounts\numClasses", DropboxAccounts.Count.ToString());


            for (int i = 0; i < FtpAccounts.Count; i++)
            {
                FtpAccount tmp = FtpAccounts[i];
                tmp.StoreValues(data, @"" + path + @"FtpAccounts\" + i + @"\");
            }
            data.SetValue(@"" + path + @"FtpAccounts\numClasses", FtpAccounts.Count.ToString());


            for (int i = 0; i < HttpAccounts.Count; i++)
            {
                HttpAccount tmp = HttpAccounts[i];
                tmp.StoreValues(data, @"" + path + @"HttpAccounts\" + i + @"\");
            }
            data.SetValue(@"" + path + @"HttpAccounts\numClasses", HttpAccounts.Count.ToString());


            for (int i = 0; i < SmtpAccounts.Count; i++)
            {
                SmtpAccount tmp = SmtpAccounts[i];
                tmp.StoreValues(data, @"" + path + @"SmtpAccounts\" + i + @"\");
            }
            data.SetValue(@"" + path + @"SmtpAccounts\numClasses", SmtpAccounts.Count.ToString());


            for (int i = 0; i < TimeServerAccounts.Count; i++)
            {
                TimeServerAccount tmp = TimeServerAccounts[i];
                tmp.StoreValues(data, @"" + path + @"TimeServerAccounts\" + i + @"\");
            }
            data.SetValue(@"" + path + @"TimeServerAccounts\numClasses", TimeServerAccounts.Count.ToString());
        }
Exemplo n.º 6
0
        public override bool Equals(object o)
        {
            if (!(o is DropboxAccount))
            {
                return(false);
            }
            DropboxAccount v = o as DropboxAccount;

            if (!AccessToken.Equals(v.AccessToken))
            {
                return(false);
            }
            if (!AccountId.Equals(v.AccountId))
            {
                return(false);
            }
            if (!AccountInfo.Equals(v.AccountInfo))
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 7
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 {}
        }