예제 #1
0
 void OnFiles(List <string> aFiles, POINT aPos)
 {
     foreach (string path in aFiles)
     {
         NClientFile file = new NClientFile(NetworkMain.server, path);
         SocketFile.NewFile(file);
         NetworkMain.server.SendFile(new JObject(), file);
     }
     // do something with the dropped file names. aPos will contain the
     // mouse position within the window where the files has been dropped.
     //Debug.Log("Dropped "+aFiles.Count+" files at: " + aPos + "\n"+
     //    aFiles.Aggregate((a, b) => a + "\n" + b));
 }
예제 #2
0
    private void Server_FileInfoReceive(ESocket socket, JObject Message, NetworkFile file)
    {
        // 파일에 대해 진행바 딜리게이트 연결
        SocketFile.NewFile(file);

        if ((bool)Message["open"]) // 내가 파일 오픈을 요청했는지 여부가 담겨있다.
        {
            // 성공적으로 파일을 받았을 경우 실행되는 이벤트
            file.Success += delegate(NetworkFile files)
            {
                System.Diagnostics.Process.Start(files.Path);
            };
        }
        file.Accept((string)Message["path"]);
    }
예제 #3
0
 public static void NewFile(NetworkFile file)
 {
     file.Start += delegate(NetworkFile thisfile)
     {
         UnityMainThreadDispatcher.Instance().Enqueue(delegate() {
             SocketFile newobject = Instantiate(Preset.objects.SocketFile, Preset.objects.SocketFileGrid.transform);
             newobject.Set(thisfile);
             Preset.objects.SocketFileGrid.repositionNow = true;
         });
     };
     file.End += delegate(NetworkFile thisfile)
     {
         UnityMainThreadDispatcher.Instance().Enqueue(delegate() {
             DestroyImmediate(SocketFile.Items[thisfile].gameObject);
             Preset.objects.SocketFileGrid.repositionNow = true;
         });
     };
 }