public void CheckTime(object sender, CheckTimeEventArgs e) { Logger.CreateLog("CheckTime_Snipe" + this._SnipeID.ToString(), "Item end: " + this.ItemEndDate.ToString() + " eBay Time: " + e.EBayTime.ToString(), null, EnumLogLevel.INFO); if (this.CheckTimeActive) { if (this.SnipeStyle == EnumSnipeStyle.Snipe && ActiveSnipe) { if (this.ItemEndDate.AddSeconds((this.SnipeDelay + e.SnipeExecutionDelay) * -1) <= e.EBayTime && this.SnipeStatus == EnumSnipeStatus.ACTIVE && !this.SnipeInProgress) { PlaceSnipeEventHandler handler = PlaceSnipeEvent; if (handler != null) handler(this); } } #warning the delay between the end of the auction is currently hard coded to 5 seconds. if (this.ItemEndDate.AddSeconds(5) < e.EBayTime && (this.SnipeStatus == EnumSnipeStatus.EXECUTED || this.SnipeStatus == EnumSnipeStatus.ACTIVE)) { CheckSnipeResultEventHandler handler = CheckSnipeResultEvent; if (handler != null) handler(this); } //System.GC.Collect(); } }
public string Timer_CheckTime() { try { UltimateSniper_BusinessObjects.Snipe.CheckTimeEventHandler handler = CheckTimeEvent; if (handler != null) { Logger.CreateLog("Beginning__Timer_Snipe_CheckTime", handler.GetHashCode().ToString(), null, EnumLogLevel.INFO); CheckTimeEventArgs e = new CheckTimeEventArgs(SL_Scheduler.GeteBayOfficialTime(), UserSettings.Default.SnipeExecutionDelay); handler(this, e); } Logger.CreateLog("Ending__Timer_Snipe_CheckTime", EnumLogLevel.INFO); } catch (Exception ex) { Logger.CreateLog("Error__Timer_Snipe_CheckTime", string.Empty, ex, EnumLogLevel.INFO); } return DateTime.Now.ToString(); }