private void _event_account_removed(clsCredentials Account)
 {
     if (OnAccountRemoved != null)
         OnAccountRemoved(this, Account);
 }
        public void RemoveAccount(clsCredentials Account)
        {
            if (Account == null)
                return;

            int i = 0;
            while (i < Accounts.Count)
            {
                if (Accounts[i].Username == Account.Username)
                {
                    _event_account_removed(Accounts[i]);
                    Accounts.RemoveAt(i);
                }
                else i++;
            }
        }
 private void _event_account_added(clsCredentials Account)
 {
     if (OnAccountAdded != null)
         OnAccountAdded(this, Account);
 }
 void _settings_OnAccountRemoved(object sender, clsCredentials Account)
 {
     RemoveAccount(Account);
 }
 public void AddAccount(clsCredentials Account)
 {
     if (Account == null)
         return;
     RemoveAccount(Account);
     this.Accounts.Add(Account);
     _event_account_added(Account);
 }
 private void RemoveAccount(clsCredentials Account)
 {
     int i = 0;
     while (i < _settings_managers.Count)
     {
         if (_settings_managers[i].Username == Account.Username)
         {
             _settings_managers[i].Dispose();
             _settings_managers.RemoveAt(i);
         }
         else
             i++;
     }
 }
 void _settings_OnAccountAdded(object sender, clsCredentials Account)
 {
     AddAccount(Account);
 }
        private void AddAccount(clsCredentials Account)
        {
            foreach (clsSettingsManager sm in _settings_managers)
                if (sm.Username == Account.Username)
                    return;

            if (Account.Password == "-")
                return;

            clsSettingsManager newSM = new clsSettingsManager(Account.Username, Account.Password);
            newSM.OnSuccess += new clsSettingsManager.SuccessEventHandler(sm_OnSuccess);
            newSM.OnFailure += new clsSettingsManager.FailureEventHandler(sm_OnFailure);
            newSM.OnException += new clsSettingsManager.ExceptionEventHandler(sm_OnException);
            newSM.OnStatusChange += new clsSettingsManager.StatusEventHandler(sm_OnStatusChange);

            _settings_managers.Add(newSM);
        }
 public void ChangeAccountRatings(clsCredentials Account, List<clsVideoEntry> Videos, bool Enable)
 {
     foreach (clsSettingsManager sm in _settings_managers)
     {
         if (sm.Username == Account.Username)
         {
             if (Enable)
             {
                 foreach (clsVideoEntry e in Videos)
                     sm.EnableVideo(e.VideoID);
             }
             else
             {
                 foreach (clsVideoEntry e in Videos)
                     sm.DisableVideo(e.VideoID);
             }
             _raise_started_action();
             return;
         }
     }
 }
 public void ChangeAccountRatings(clsCredentials Account, string VideoID, bool Enable)
 {
     foreach (clsSettingsManager sm in _settings_managers)
     {
         if (sm.Username == Account.Username)
         {
             if (Enable)
                 sm.EnableVideo(VideoID);
             else
                 sm.DisableVideo(VideoID);
             _raise_started_action();
             return;
         }
     }
 }
 public void RemoveAccount(clsCredentials Account)
 {
     int i = 0;
     while (i < _feed_readers.Count)
     {
         if (_feed_readers[i].Username == Account.Username)
         {
             _feed_readers[i].Dispose();
             _feed_readers.RemoveAt(i);
         }
         else
             i++;
     }
 }
        public void AddAccount(clsCredentials Account)
        {
            foreach (clsVideoFeedReader r in _feed_readers)
                if (r.Username == Account.Username)
                    return;

            clsVideoFeedReader new_feed = new clsVideoFeedReader(_dev_key, _app_name, Account.Username);
            if (Account.Password != "-")
                new_feed.SetCredentials(Account.Username, Account.Password);

            new_feed.OnEntryFetched += new clsVideoFeedReader.EntryFetchedHandler(new_feed_OnEntryFetched);
            new_feed.OnStatusChange += new clsVideoFeedReader.StatusChangeHandler(new_feed_OnStatusChange);
            new_feed.OnException += new clsVideoFeedReader.ExceptionHandler(new_feed_OnException);
            _feed_readers.Add(new_feed);
        }