public override bool Equals(object o) { if (!(o is TimeServerAccount)) { return(false); } TimeServerAccount v = o as TimeServerAccount; if (!AccountId.Equals(v.AccountId)) { return(false); } if (!IsSecured.Equals(v.IsSecured)) { return(false); } if (!Password.Equals(v.Password)) { return(false); } if (!Url.Equals(v.Url)) { return(false); } if (!UserName.Equals(v.UserName)) { return(false); } return(true); }
public void CopyTo(TimeServerAccount targetAccount) { var data = Data.CreateDataStorage(); StoreValues(data, ""); targetAccount.ReadValues(data, ""); }
public TimeServerAccount Copy() { TimeServerAccount copy = new TimeServerAccount(); copy.AccountId = AccountId; copy.IsSecured = IsSecured; copy.Password = Password; copy.Url = Url; copy.UserName = UserName; return(copy); }
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()); }
public void ReplaceWith(TimeServerAccount source) { if (AccountId != source.AccountId) { AccountId = source.AccountId; } if (IsSecured != source.IsSecured) { IsSecured = source.IsSecured; } Password = source.Password; if (Url != source.Url) { Url = source.Url; } if (UserName != source.UserName) { UserName = source.UserName; } }
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 {} }