Пример #1
0
        // ============================================
        // PROTECTED (Methods) Event Handlers
        // ============================================
        protected void OnDragDataReceived(object sender, DragDataReceivedArgs args)
        {
            // Get Drop Paths
            object[] filesPath = Dnd.GetDragReceivedPaths(args);

            if (this.userInfo == MyInfo.GetInstance())
            {
                // Copy Selected Files Into Directory
                foreach (string filePath in filesPath)
                {
                    FileUtils.CopyAll(filePath, currentDirectory.FullName);
                }

                // Refresh Icon View
                Refresh();
            }
            else
            {
                // Send Files
                foreach (string filePath in filesPath)
                {
                    PeerSocket peer   = (PeerSocket)P2PManager.KnownPeers[userInfo];
                    bool       fisDir = FileUtils.IsDirectory(filePath);

                    Debug.Log("Send To '{0}' URI: '{1}'", userInfo.Name, filePath);
                    if (FileSend != null)
                    {
                        FileSend(peer, filePath, fisDir);
                    }
                }
            }

            Drag.Finish(args.Context, true, false, args.Time);
        }
Пример #2
0
        // ============================================
        // PROTECTED (Methods) Event Handlers
        // ============================================
        protected void OnDragDataReceived(object sender, DragDataReceivedArgs args)
        {
            IconViewDropPosition pos;
            TreePath             path;

            // Get Dest Item Position
            if (iconView.GetDestItemAtPos(args.X, args.Y, out path, out pos) == false)
            {
                Drag.Finish(args.Context, false, false, args.Time);
                return;
            }

            // Select Item (Change Icon To Activate it)
            UserInfo userInfo = store.GetUserInfo(path);

            // Get Drop Paths
            object[] filesPath = Dnd.GetDragReceivedPaths(args);
            foreach (string filePath in filesPath)
            {
                Debug.Log("Send To '{0}' URI: '{1}'", userInfo.Name, filePath);
                if (SendFile != null)
                {
                    SendFile(this, userInfo, filePath);
                }
            }

            Drag.Finish(args.Context, true, false, args.Time);
        }
Пример #3
0
        // ============================================
        // PROTECTED (Methods) Event Handlers
        // ============================================
        protected void OnDragDataReceived(object sender, DragDataReceivedArgs args)
        {
            if (this.userInfo == MyInfo.GetInstance())
            {
                return;
            }

            // Get Drop Paths
            object[] filesPath = Dnd.GetDragReceivedPaths(args);
            foreach (string filePath in filesPath)
            {
                PeerSocket peer   = (PeerSocket)P2PManager.KnownPeers[userInfo];
                bool       fisDir = FileUtils.IsDirectory(filePath);

                Debug.Log("Send To '{0}' URI: '{1}'", userInfo.Name, filePath);
                if (FileSend != null)
                {
                    FileSend(peer, filePath, fisDir);
                }
            }

            Drag.Finish(args.Context, true, false, args.Time);
        }