Example #1
0
 public static AccountBase Create(ChooseAccount choice, AccountCredentials credit, AccountNavigation navig)
 {
     AccountBase acc = null;
     switch (choice)
     {
         case ChooseAccount.Main:
             {
                 credit = Framework.Inst.CredentialsList[0];
                 credit.AccountId = 1;
                 acc = new BossaAccount(credit, navig);
                 break;
             }
         case ChooseAccount.Account1:
             {
                 credit = Framework.Inst.CredentialsList[1];
                 credit.AccountId = 2;
                 acc = new BossaAccount(credit, navig);
                 break;
             }
     //    case ChooseAccount.Test:
     //        {
     //            if(credit == null)
     //                credit = new Credentials();
                 
     //            acc = new BossaAccount(credit, navig);
     //            break;
     //        }
     }
     
     return acc;
 }
Example #2
0
        public AccountBase(AccountCredentials cred, AccountNavigation navig) 
        {
            if (cred == null)
                throw new ArgumentNullException("Credentials must be passed!");

            if (navig == null)
                throw new ArgumentNullException("AccountNavigation must be passed!");

            //LastPosition = new Position(0, 0, DateTime.Now);
            Credentials = cred;
            this.Links = navig;
        }
Example #3
0
        public bool ReadAccountSettingsFromFile()
        {
            bool result = true;
            try
            {
                XDocument xml = XDocument.Load(settingFileName);
                IEnumerable<AccountCredentials> lista =
                    from account in xml.Descendants("Account")
                    orderby account.Attribute("Id").Value.Parse<int>()
                    select new AccountCredentials()
                    {
                        AccountId = account.Attribute("Id").Value.Parse<int>(),
                        Login = account.Attribute("Login").Value,
                        Pass = account.Attribute("Pass").Value
                    };

                CredentialsList = new List<AccountCredentials>(lista);
                MailFrom = CredentialsList[0];
                MailSignal = CredentialsList[1];
            }
            catch (Exception)
            {
                result = false;
                //throw;
            }
            return result;
        } 
Example #4
0
 public BossaAccount(AccountCredentials cred, AccountNavigation navig) : base(cred, navig)
 { }
Example #5
0
        //public int MailsInInbox = 0;

        public GmailWatcher(AccountCredentials cred)
        {
            string login = cred.Login;
            string pass = cred.Pass;
            reader = new GmailReader(login, pass);
        }