예제 #1
0
파일: MessageForm.cs 프로젝트: mansehr/DGP
        private void UpdateReciveActivity(FileTransfer fileTransfer, SendFileEvent sfe)
        {
            ReciveFile reciveFile  = (ReciveFile)fileTransfer;
            if(sfe.fileSendStatus == TransferStatus.CONFIRM_RECIVE)
            {
                //UpdateFiletransferData(fileTransfer);

                for(int i = 0; i < fileActivity.Count; i++)
                {
                    Activity ac = (Activity)fileActivity[i];
                    if(fileTransfer.Equals(ac.fileTransfer))
                    {
                        ac.linkLabel.Text = "Spara filen!";
                    }
                }

                DisplayMessage(this.contact.Name + " Vill skicka filen \"" + reciveFile.FileName.Trim() + "\" till dig. " +
                            "Klicka på transfersknappen för att visa fildelningsfönstret där du kan välja att spara filen.", Color.SkyBlue, "", false);
            }
            else if(sfe.fileSendStatus == TransferStatus.FILE_RECIVING)
            {
            //	UpdateFiletransferData(fileTransfer);

                DisplayMessage("recived bytes" + fileTransfer.TransferedBytes, Color.SaddleBrown, "", false);

                //this.Invoke(new DisplayMessageDelegate(this.DisplayMessage), new  object []{"Recived Bytes: " + reciveFile.RecivedBytes.ToString() + "/" + reciveFile.FileSize, Color.SaddleBrown, "", false});
            }
            else if(sfe.fileSendStatus == TransferStatus.RECIVE_OK)
            {
                DisplayMessage("Recive OK", Color.SaddleBrown, "", false);
                reciveFile.close();

            //	UpdateFiletransferData(fileTransfer);
            }
            else if(sfe.fileSendStatus == TransferStatus.SOCKET_EXCEPTION)
            {
            }
            //		else
            {
                DisplayMessage("Recive event: " + sfe.fileSendStatus.ToString() + '\n', Color.SaddleBrown, "", false);
            }
        }
예제 #2
0
파일: MessageForm.cs 프로젝트: mansehr/DGP
        public void UpdateSendActivity(FileTransfer fileTransfer, SendFileEvent sfe)
        {
            SendFile sendFile = (SendFile)fileTransfer;
            if(sfe.fileSendStatus == TransferStatus.START_SEND)
            {
                DisplayMessage("Sending file: ", Color.SaddleBrown, "", false);

            //	UpdateFiletransferData(fileTransfer);
            }
            else if(sfe.fileSendStatus == TransferStatus.FILE_SENDING)
            {
                //string tempString = "Sending Bytes: " + sendFile.ReadBytes.ToString() + "/" + sendFile.FileSize.ToString();
            //	UpdateFiletransferData(fileTransfer);

                //this.Invoke(new DisplayMessageDelegate(this.DisplayMessage), new  object []{tempString, Color.SaddleBrown, "", false});
            }
            else if(sfe.fileSendStatus == TransferStatus.SEND_OK)
            {
                DisplayMessage("Send OK!", Color.SaddleBrown, "", false);

            //	UpdateFiletransferData(fileTransfer);
                //label3.Text = "Sending Bytes: Done!";
                //sendFile.close();
            }
            else if(sfe.fileSendStatus == TransferStatus.SOCKET_EXCEPTION)
            {
            }
            //	else
            {
                DisplayMessage("Send event: " + sfe.fileSendStatus.ToString() + '\n', Color.SaddleBrown, "", false);
            }
        }
예제 #3
0
파일: MessageForm.cs 프로젝트: mansehr/DGP
 private void sendFile_SendFileChangeEvent(object sender, SendFileEvent sfe)
 {
     this.Invoke(new UpdateSendActivityDelegate(this.UpdateSendActivity), new object[] { (FileTransfer)sender, sfe});
 }