示例#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);
        }
        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) {
 }