Esempio n. 1
0
 // =================================================
 // PROTECTED (Methods) Network Viewer Event Handlers
 // =================================================
 private void OnSendFile(object obj, UserInfo userInfo, string path)
 {
     Gtk.Application.Invoke(delegate {
         PeerSocket peer = P2PManager.KnownPeers[userInfo] as PeerSocket;
         UploadManager.Add(peer, path);
     });
 }
 // ===================================================
 // PRIVATE (Methods) Protocol Event Handler
 // ===================================================
 private void OnAcceptFileEvent(PeerSocket peer, XmlRequest xml)
 {
     try {
         string   path     = (string)xml.Attributes["path"];
         UserInfo userInfo = peer.Info as UserInfo;
         UploadManager.Add(userInfo, path);
     } catch (Exception e) {
         Glue.Dialogs.MessageError("Accept File", "Peer Ip: " +
                                   peer.GetRemoteIP().ToString() + "\n" +
                                   e.Message);
     }
 }
Esempio n. 3
0
        private void OnSendFileMenu(object obj, string path, bool isDir)
        {
            Gtk.Application.Invoke(delegate {
                if (isDir == true)
                {
                    Base.Dialogs.MessageError("Ask Send File Error",
                                              "Directory Send Not Supported (Now)");
                    return;
                }

                PeerSocket peer = obj as PeerSocket;
                UploadManager.Add(peer, path);
            });
        }