예제 #1
0
        public DropboxAccount Copy()
        {
            DropboxAccount copy = new DropboxAccount();

            copy.AccessToken = AccessToken;
            copy.AccountId   = AccountId;
            copy.AccountInfo = AccountInfo;
            return(copy);
        }
예제 #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());
 }
예제 #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 {}
 }
예제 #4
0
        public void ReplaceWith(DropboxAccount source)
        {
            AccessToken = source.AccessToken;
            if (AccountId != source.AccountId)
            {
                AccountId = source.AccountId;
            }

            if (AccountInfo != source.AccountInfo)
            {
                AccountInfo = source.AccountInfo;
            }
        }
예제 #5
0
파일: Accounts.cs 프로젝트: sm2x/PDFCreator
        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());
        }
예제 #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);
        }
예제 #7
0
파일: Accounts.cs 프로젝트: sm2x/PDFCreator
        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 {}
        }