Exemple #1
0
 public WebPagesDownloader(IWorkerState State, DefaultSettings Settings)
 {
     _State              = State;
     _Settings           = Settings;
     _WebClient.Proxy    = _Settings.Proxy;
     _WebClient.Encoding = Encoding.UTF8;
     LastState           = "";
 }
    public void ChangeState(IWorkerState newState)
    {
        if (_currentState != null)
        {
            _currentState.Exit();
        }

        _currentState = newState;
        _currentState.Enter(this);
    }
Exemple #3
0
 public virtual Exception Prepare(IDataSaver DataSaver, IWorkerState State, DefaultSettings Settings)
 {
     try {
         _Settings  = Settings;
         _DataSaver = DataSaver;
         _State     = State;
         return(null);
     } catch (Exception ex) {
         return(ex);
     }
 }