Пример #1
0
 public clsActors(string ApplicationName, string DevKey)
 {
     _Settings = new clsSettings();
     _Collector = new clsStatMonger(DevKey, ApplicationName, _Settings.Accounts, _Settings);
     _Analyzer = new clsStatMasher(_Collector.InitialDataSet, _Collector.HistoricalDataPoints);
     _ED = new clsED(_Settings);
 }
Пример #2
0
        public clsED(clsSettings Settings)
        {
            _settings = Settings;
            _settings.OnAccountAdded += new clsSettings.AccountAddedHandler(_settings_OnAccountAdded);
            _settings.OnAccountRemoved += new clsSettings.AccountRemovedHandler(_settings_OnAccountRemoved);

            if (_settings.ED_Log_File != null && _settings.ED_Log_File != string.Empty)
                _logger = new clsFileLogger(_settings.ED_Log_File);

            foreach (clsCredentials Account in _settings.Accounts)
            {
                if (Account.Password == "-")
                    continue;
                clsSettingsManager sm = new clsSettingsManager(Account.Username, Account.Password);
                sm.OnException += new clsSettingsManager.ExceptionEventHandler(sm_OnException);
                sm.OnFailure += new clsSettingsManager.FailureEventHandler(sm_OnFailure);
                sm.OnStatusChange += new clsSettingsManager.StatusEventHandler(sm_OnStatusChange);
                sm.OnSuccess += new clsSettingsManager.SuccessEventHandler(sm_OnSuccess);
                _settings_managers.Add(sm);
            }
        }
Пример #3
0
        // constructor
        public clsStatMonger(string DeveloperKey, string ApplicationName, List<clsCredentials> Credentials, clsSettings settings)
        {
            _file_logger = new clsFileLogger("CollectorData.log");
            _settings = settings;
            _settings.OnAccountAdded += new clsSettings.AccountAddedHandler(_settings_OnAccountAdded);
            _settings.OnAccountRemoved += new clsSettings.AccountRemovedHandler(_settings_OnAccountRemoved);

            _dev_key = DeveloperKey;
            _app_name = ApplicationName;

            this.Enabled = false;

            _update_timer = new System.Timers.Timer();
            _update_timer.Enabled = false;
            _update_timer.Interval = _settings.Collect_Interval * 1000 * 60;
            _update_timer.Elapsed += new ElapsedEventHandler(_update_timer_Elapsed);

            _accounts = Credentials;
            foreach (clsCredentials c in _accounts)
            {
                clsVideoFeedReader new_feed = new clsVideoFeedReader(DeveloperKey, ApplicationName, c.Username);
                if (c.Password != string.Empty && c.Password != "-")
                    new_feed.SetCredentials(c.Username, c.Password);
                new_feed.OnEntryFetched += new clsVideoFeedReader.EntryFetchedHandler(new_feed_OnEntryFetched);
                new_feed.OnStatusChange += new clsVideoFeedReader.StatusChangeHandler(new_feed_OnStatusChange);
                _feed_readers.Add(new_feed);
            }
        }