public void finaliseDownload(Boolean success)
 {
     Console.WriteLine("::finaliseDownload()");
     Console.WriteLine("::finaliseDownload() - removed the downloadHandler");
     comPort.DataReceived -= downloadHandler;
     _recvTransType        = ReceiveTransmissionType.Sync;
     if (Status(false) != State.LoggedIn)
     {
         sendAbort();
         if (Status(false) != State.LoggedIn)
         {
             Console.WriteLine("Problem aborting download");
         }
     }
     dl.file.Close();
     dl.downloading = false;
     dl.finaliseCallback(success);
 }
Example #2
0
        public void finaliseDownload(Boolean success)
        {
            debugLog("::finaliseDownload()");
            debugLog("::finaliseDownload() - removed the downloadHandler");
            comPort.DataReceived -= downloadHandler;
            _recvTransType        = ReceiveTransmissionType.Sync;
            //string st = comPort.ReadExisting();
            Thread.Sleep(200);
            string st = comPort.ReadExisting().ToLower();

            if (st.Length > 400 && !st.Contains("return") && !st.Contains("statistics"))
            {
                sendAbort();
            }

            dl.file.Close();
            dl.downloading = false;
            form.BeginInvoke(new EventHandler(delegate { dl.finaliseCallback(success); }));
        }