コード例 #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);
     });
 }
コード例 #2
0
 // ===================================================
 // 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);
     }
 }
コード例 #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);
            });
        }