public void Add(UploadDocumentCompletedEventHandler onComplete)
 {
     if (up != null)
     {
         up.UploadDocumentCompleted += onComplete;
     }
     else if (!handlers.ContainsKey(onComplete))
     {
         wc.UploadDataCompleted += (handlers [onComplete] = delegate(object sender, UploadDataCompletedEventArgs e) {
             object [] result = new object [0];
             string msg;
             Exception error = e.Error;
             try {
                 result = new object [] { msg = Encoding.Default.GetString(e.Result) };
                 if (msg.StartsWith("roxupex::", StringComparison.InvariantCultureIgnoreCase))
                 {
                     error = new Exception(msg.Substring("roxupex::".Length));
                     msg = string.Empty;
                 }
             } catch {
             }
             onComplete(sender, new UploadDocumentCompletedEventArgs(result, error, e.Cancelled, e.UserState));
         });
     }
 }
 public void Remove(UploadDocumentCompletedEventHandler onComplete)
 {
     if (up != null)
     {
         up.UploadDocumentCompleted -= onComplete;
     }
     else if (handlers.ContainsKey(onComplete))
     {
         wc.UploadDataCompleted -= (handlers [onComplete]);
         handlers.Remove(onComplete);
     }
 }