Exemplo n.º 1
0
 // -------------------------------------
 public void NewFile(object source, NewFileWarningEventArgs args)
 {
     try
     {
         MessageBox.Show("Novo ficheiro adicionado: " + args.Filename);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
     }
 }
Exemplo n.º 2
0
        void NewFileAdded(string filename)
        {
            if (null == toPeerFileWarningDelegate)
            {
                return;
            }

            AsyncCallback asyncCallback = new AsyncCallback(FileWarningAsyncCallbackHandler);

            Delegate[] invokeList = toPeerFileWarningDelegate.GetInvocationList();
            NewFileWarningEventArgs newFileWarningArgs = new NewFileWarningEventArgs(filename);
            foreach (Delegate d in invokeList)
            {
                NewFileWarningEventHandler handler = (NewFileWarningEventHandler)d;

                IAsyncResult asyncResult = handler.BeginInvoke
                    (this, newFileWarningArgs, asyncCallback, handler);
            }
        }
Exemplo n.º 3
0
 public void Handler(object sender, NewFileWarningEventArgs args)
 {
     form.Invoke(new NewFileWarningEventHandler(form.NewFile), sender, args);
 }
Exemplo n.º 4
0
 public void NewFile(IPeerToPeer source, NewFileWarningEventArgs args)
 {
     if (null != toUserFileWarningDelegate)
     {
         toUserFileWarningDelegate(source, args);
     }
 }