Example #1
0
        private static void Read_onReadFrag(object sender, FileFragHelper_Read e)
        {
            var channel = findDataChannelByGuid(e.CurrentFileInfo.fileGuid);

            if (channel == null)
            {
                return;
            }
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                FileChannelMessageDeal.sendFileFrag(channel, e);
            }));
        }
Example #2
0
        public static void SelectFileToSend(DataChannel channel)
        {
            FileFragHelper_Read read = new FileFragHelper_Read();

            read.onReadFrag      += Read_onReadFrag;
            read.onEndReadFrag   += Read_onEndReadFrag;
            read.onReadFragError += Read_onReadFragError;
            var res = read.SelectFileToFragSend();

            if (res == false)
            {
                read.onReadFrag      -= Read_onReadFrag;
                read.onEndReadFrag   -= Read_onEndReadFrag;
                read.onReadFragError -= Read_onReadFragError;
                return;
            }
            else
            {
                addFileReader(channel, read);
                FileChannelMessageDeal.startSendFile(channel, read);
                read.StartRead();
            }
        }