Beispiel #1
0
        internal void Local_DataDropped(object sender, ClipboardDataBase cbData)
        {
            if (!server.IsConnected)
            {
                return;
            }

            if (server.IsConnected)
            {
                Guid opId = Guid.NewGuid();
                CurrentOperation = new ClientDataOperation(cbData, opId);
                ISLogger.Write("LocalDragDropController: Started dragdrop operation " + opId);
                server.SendDragDropData(cbData.ToBytes(), opId);
            }
        }
Beispiel #2
0
        internal void Local_DataDropped(object sender, ClipboardDataBase cbData)
        {
            if (!Server.IsConnected)
            {
                return;
            }

            if (CurrentOperation != null && !previousOperations.ContainsKey(CurrentOperation.OperationId))
            {
                previousOperations.Add(CurrentOperation.OperationId, CurrentOperation);
            }

            if (Server.IsConnected)
            {
                Guid opId = Guid.NewGuid();
                CurrentOperation = new DragDropOperation(opId, cbData);
                ISLogger.Write("LocalDragDropController: Started dragdrop operation " + opId);
                Server.SendDragDropData(cbData.ToBytes(), opId);
            }
        }
Beispiel #3
0
        private void BeginTextOrImageOperation(ClipboardDataBase cbData, Guid operationId)
        {
            //If the previous dragdrop operation is still transfering files, store it so that the files can keep being transfered
            if (CurrentOperation != null && CurrentOperation.State == DragDropState.TransferingFiles)
            {
                previousOperationIds.Add(CurrentOperation.OperationId, CurrentOperation);
            }


            //Create a new operation with the text/image data, we don't care about the ID or host
            //as text and image data is not streamed the same way as file data. Text/Image data are sent as a single block
            CurrentOperation = new DragDropOperation(cbData, null, operationId);

            if (currentInputClient.IsLocalhost)
            {
                ddManager.DoDragDrop(cbData, operationId);
            }
            else
            {
                ISLogger.Write("SDragDropController: Sending dragdrop type {0} to {1}", cbData.DataType, currentInputClient.ClientName);
                currentInputClient.SendDragDropData(cbData.ToBytes(), CurrentOperation.OperationId);
            }
        }