diff --git a/MarketWatch.Designer.cs b/MarketWatch.Designer.cs index aa97e33..870ab2a 100644 --- a/MarketWatch.Designer.cs +++ b/MarketWatch.Designer.cs @@ -249,7 +249,7 @@ this.materialLabel3.Name = "materialLabel3"; this.materialLabel3.Size = new System.Drawing.Size(162, 18); this.materialLabel3.TabIndex = 6; - this.materialLabel3.Text = "Version : 2017.02.03.11"; + this.materialLabel3.Text = "Version : 2017.02.06.12"; // // lvItems // diff --git a/PriceCheck.cs b/PriceCheck.cs index d710ccf..c6375f8 100644 --- a/PriceCheck.cs +++ b/PriceCheck.cs @@ -26,6 +26,9 @@ namespace MarketWatchNS MarketWatch m_Listener = null; bool m_bEnd = false; + bool m_bCancel = true; + int m_iCheckTimeInSec; + System.Timers.Timer m_Timer = new System.Timers.Timer(); public PriceCheck(int iSeq, string strCode, string strCodeName, MarketWatch Listener, int iTimeInSec) @@ -43,14 +46,34 @@ namespace MarketWatchNS m_StockCur.Received += StockCur_Received; m_StockCur.Subscribe(); - m_Timer.Interval = iTimeInSec*1000; + m_iCheckTimeInSec = iTimeInSec; + m_bCancel = true; + m_Timer.Interval = 10*1000; m_Timer.Elapsed += Timer_Elapsed; m_Timer.Start(); } private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { - Stop(); + if(m_bCancel == true) + { + if(m_iStartPrice < 0) + { + Stop(); + } + else + { + m_Timer.Stop(); + m_Timer.Interval = (m_iCheckTimeInSec-10)*1000; + m_Timer.Start(); + } + + m_bCancel = false; + } + else + { + Stop(); + } } public bool IsEnd()