예제 #1
0
 internal virtual void SetState(ITransferState newState)
 {
     lock (this)
     {
         State         = DecorateForLogging(newState);
         State.Context = this;
         State.OnStateEnter();
     }
 }
예제 #2
0
 public TFtpTransfer(ITransferChannel connection, string filename, ITransferState initialState)
 {
     ProposedOptions = TransferOptionSet.NewDefaultSet();
     Filename        = filename;
     RetryCount      = 5;
     SetState(initialState);
     Connection = connection;
     Connection.OnCommandReceived += Connection_OnCommandReceived;
     Connection.OnError           += Connection_OnError;
     Connection.Open();
     Timer = new Timer(Timer_OnTimer, null, 500, 500);
 }
예제 #3
0
 public TftpTransfer(ITransferChannel connection, String filename, ITransferState initialState)
 {
     this.ProposedOptions = TransferOptionSet.NewDefaultSet();
     this.Filename        = filename;
     this.RetryCount      = 5;
     this.SetState(initialState);
     this.connection = connection;
     this.connection.OnCommandReceived += new TftpCommandHandler(connection_OnCommandReceived);
     this.connection.OnError           += new TftpChannelErrorHandler(connection_OnError);
     this.connection.Open();
     this.timer = new Timer(timer_OnTimer, null, 500, 500);
 }
예제 #4
0
 protected virtual ITransferState DecorateForLogging(ITransferState state)
 {
     return(TFtpTrace.Enabled ? new LoggingStateDecorator(state, this) : state);
 }
예제 #5
0
 public LoggingStateDecorator(ITransferState decoratee, TftpTransfer transfer)
 {
     this.decoratee = decoratee;
     this.transfer  = transfer;
 }
예제 #6
0
 protected override ITransferState DecorateForLogging(ITransferState state)
 {
     return(state);
 }