private void timerSendServer_Tick(object sender, EventArgs e) { __Set_LogMsg( Properties.Resources.LogResend ); Task t1 = Task.Factory.StartNew(() => { InputSorage fs = stRv.LastFileSorage; if ((fs == null) || (__SourceProcessed(fs.fPath, fs.fName))) { flatThreadSafe.Run(this, (Action)(() => this.toolStripMenuItem3_Click(sender, e) )); } }); t1.ContinueWith((o) => { o.Dispose(); }, TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.NotOnCanceled); t1.ContinueWith((o) => { __Set_LogMsg( string.Format( Properties.Resources.LogTaskError, o.Status.ToString(), ((o.Exception != null) ? o.Exception.Message : "-") ) ); o.Dispose(); }, TaskContinuationOptions.OnlyOnFaulted); }
/// <summary> /// /// </summary> /// <param name="fPath"></param> /// <param name="fName"></param> public void AddToFileSorage(string fPath, string fName) { InputSorage fs = new InputSorage(fPath, fName); LastFileSorage = fs; }