예제 #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) {
 }