계좌 선택 기능 추가
This commit is contained in:
52
NewsForm.cs
52
NewsForm.cs
@@ -37,7 +37,6 @@ namespace NewsCrawler
|
||||
|
||||
Config.Init();
|
||||
Util.SetLogView(tbLog);
|
||||
m_ConfigForm = new ConfigForm(this);
|
||||
m_CodeList = new CodeList();
|
||||
m_Condition = new TextCondition();
|
||||
|
||||
@@ -65,9 +64,12 @@ namespace NewsCrawler
|
||||
lvList.SelectedItems[0].EnsureVisible();
|
||||
}
|
||||
|
||||
Console.WriteLine(string.Format("{0} ddd", m_CrawlTimer.SynchronizingObject));
|
||||
Console.WriteLine(string.Format("init thread {0}", System.Threading.Thread.CurrentThread.ManagedThreadId.ToString()));
|
||||
m_CrawlTimer.Elapsed+=CrawlTimer_Tick;
|
||||
m_CrawlTimer.Interval=m_iCrawlInterval;
|
||||
m_CrawlTimer.Start();
|
||||
|
||||
|
||||
m_CybosHelper = new CybosHelper();
|
||||
|
||||
@@ -131,7 +133,10 @@ namespace NewsCrawler
|
||||
if(m_bBuy == true)
|
||||
{
|
||||
ModelessPopup ManualPopup = new ModelessPopup(this);
|
||||
ManualPopup.SetMessage(string.Format("{0} 매수하시겠습니까?", Code.ToString()), Code);
|
||||
ManualPopup.SetMessage(string.Format("{0}\n[{1}] {2}\n(keyword:{3}, code:{4})\n\n매수하시겠습니까?",
|
||||
DateTime.Now.ToString("[hh:mm:ss]"),
|
||||
strRef, strTitle, MatchResult.m_strKeyword, Code), Code);
|
||||
ManualPopup.TopMost = true;
|
||||
ManualPopup.Show();
|
||||
}
|
||||
break;
|
||||
@@ -232,7 +237,7 @@ namespace NewsCrawler
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return bHasNew;
|
||||
@@ -282,7 +287,7 @@ namespace NewsCrawler
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return bHasNew;
|
||||
@@ -340,7 +345,7 @@ namespace NewsCrawler
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return bHasNew;
|
||||
@@ -398,7 +403,7 @@ namespace NewsCrawler
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return bHasNew;
|
||||
@@ -452,7 +457,7 @@ namespace NewsCrawler
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return bHasNew;
|
||||
@@ -511,7 +516,7 @@ namespace NewsCrawler
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return bHasNew;
|
||||
@@ -558,7 +563,7 @@ namespace NewsCrawler
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Util.Log(Util.LOG_TYPE.ERROR, e.ToString());
|
||||
Console.WriteLine(e.ToString());
|
||||
}
|
||||
|
||||
return bHasNew;
|
||||
@@ -591,6 +596,8 @@ namespace NewsCrawler
|
||||
{
|
||||
m_CrawlTimer.Enabled = false;
|
||||
|
||||
Console.WriteLine(string.Format("timer thread {0}", System.Threading.Thread.CurrentThread.ManagedThreadId.ToString()));
|
||||
|
||||
if(chAutoReload.Checked == true)
|
||||
{
|
||||
ReadKIND();
|
||||
@@ -615,7 +622,7 @@ namespace NewsCrawler
|
||||
|
||||
string strURL = lvList.SelectedItems[0].SubItems[chLink.Index].Text;
|
||||
wbView.ScriptErrorsSuppressed = true;
|
||||
wbView.Navigate(strURL);
|
||||
//wbView.Navigate(strURL);
|
||||
}
|
||||
|
||||
private void tbInterval_KeyPress(object sender, KeyPressEventArgs e)
|
||||
@@ -641,6 +648,9 @@ namespace NewsCrawler
|
||||
|
||||
private void btnConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(m_ConfigForm == null)
|
||||
m_ConfigForm = new ConfigForm(this);
|
||||
|
||||
FormCollection OpenForms = Application.OpenForms;
|
||||
bool bOpen = false;
|
||||
foreach(Form form in OpenForms)
|
||||
@@ -662,6 +672,11 @@ namespace NewsCrawler
|
||||
}
|
||||
}
|
||||
|
||||
public void OnConfigFormClosing()
|
||||
{
|
||||
m_ConfigForm = null;
|
||||
}
|
||||
|
||||
public void OnManualCodeClick(int iPrice)
|
||||
{
|
||||
m_CodeList.MakeManualList(iPrice);
|
||||
@@ -705,11 +720,28 @@ namespace NewsCrawler
|
||||
{
|
||||
m_bBuy = chBuy.Checked;
|
||||
|
||||
if(m_bBuy == true && Config.GetAccount() == "")
|
||||
{
|
||||
chBuy.Checked = false;
|
||||
MessageBox.Show("계좌를 선택해주시기 바랍니다");
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_bBuy == true)
|
||||
Util.Log(Util.LOG_TYPE.VERVOSE, "매수 시작");
|
||||
else
|
||||
Util.Log(Util.LOG_TYPE.VERVOSE, "매수 취소");
|
||||
}
|
||||
|
||||
public string[] GetAccounts()
|
||||
{
|
||||
return m_CybosHelper.GetAccounts();
|
||||
}
|
||||
|
||||
public void ApplyAccount(string strAccount, string strAccountSub)
|
||||
{
|
||||
Config.SetAccount(strAccount, strAccountSub);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user