FileControl() public method

Sends a file control command to a friend for a given file transfer.
public FileControl ( int friendNumber, int fileNumber, ToxFileControl control ) : bool
friendNumber int The friend to send the file control to.
fileNumber int The file transfer that this control is meant for.
control ToxFileControl The control to send.
return bool
示例#1
0
        public IncomingFileTransfer(ToxEventArgs.FileSendRequestEventArgs e, Tox tox, string savepath)
        {
            Tox = tox;

            ViewModel.SavePath = savepath;
            ViewModel.ID = e.FileNumber;
            ViewModel.Sender = e.FriendNumber;
            ViewModel.TotalBytes = e.FileSize;

            try
            {
                FileStream = new FileStream(ViewModel.SavePath, FileMode.Create);
            }
            catch
            {
                Dispose();
            }

            Tox.FileControl(ViewModel.Sender, ViewModel.ID, ToxFileControl.Resume);

            Tox.OnFileChunkReceived += Tox_OnFileChunkReceived;
            Tox.OnFileControlReceived += Tox_OnFileControlReceived;

            OnComplete += (v) => { Dispose(); };
        }