Пример #1
0
        public void ReadLineAsync(Action <FtpReply> callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            Func <string> w = ReadRawLine;

            w.BeginInvoke(asyncResult =>
            {
                FtpReply result = null;
                try
                {
                    result = new FtpReply(w.EndInvoke(asyncResult));
                }
                finally
                {
                    callback.Invoke(result);
                }
            }, null);
        }
Пример #2
0
        public void ReadLineAsync(Action<FtpReply> callback)
        {
            if (callback == null) throw new ArgumentNullException("callback");

            Func<string> w = ReadRawLine;
            w.BeginInvoke(asyncResult =>
            {
                FtpReply result = null;
                try
                {
                    result = new FtpReply(w.EndInvoke(asyncResult));
                }
                finally
                {
                    callback.Invoke(result);
                }
            }, null);
        }
Пример #3
0
 /// <summary>
 /// Initalizes a new instance of a FtpResponseException
 /// </summary>
 /// <param name="reply">The FtpReply to build the exception from</param>
 public FtpCommandException(FtpReply reply)
     : this(reply.Code, reply.Message + reply.InfoMessages)
 {
 }
Пример #4
0
 /// <summary>
 /// Initalizes a new instance of a FtpResponseException
 /// </summary>
 /// <param name="reply">The FtpReply to build the exception from</param>
 public FtpCommandException(FtpReply reply)
     : this(reply.Code, reply.Message + reply.InfoMessages) {
 }