- 종목명 검색 개선

- 엑셀 핸들러 추가
- 기타 코드 정리
This commit is contained in:
2017-01-10 19:22:02 +09:00
parent 349de89a05
commit ea5165a4aa
8 changed files with 286 additions and 159 deletions

13
Util.cs
View File

@@ -28,6 +28,9 @@ namespace NewsCrawler
static string m_strLogFile = null;
static RichTextBox m_LogBox = null;
delegate void InsertLogDelegate(RichTextBox LogBox, LOG_TYPE enType, string strLog);
static InsertLogDelegate m_InsertLogDelegate = new InsertLogDelegate(InsertLog);
public static void SetLogView(RichTextBox logBox)
{
m_LogBox = logBox;
@@ -38,16 +41,11 @@ namespace NewsCrawler
m_LogBox = null;
}
delegate void InsertLogDelegate(RichTextBox LogBox, LOG_TYPE enType, string strLog);
static void InsertLog(RichTextBox LogBox, LOG_TYPE enType, string strLog)
{
Form mainForm = (Application.OpenForms.Count > 0) ? Application.OpenForms[0] : null;
bool bInvoke = mainForm != null ? mainForm.InvokeRequired || LogBox.InvokeRequired : LogBox.InvokeRequired;
if(LogBox.InvokeRequired)
{
LogBox.Invoke(new InsertLogDelegate(InsertLog), LogBox, enType, strLog);
LogBox.Invoke(m_InsertLogDelegate, LogBox, enType, strLog);
}
else
{
@@ -93,9 +91,6 @@ namespace NewsCrawler
public static void Log(LOG_TYPE enType, string strLog)
{
if(strLog.Contains("인덱스"))
Console.WriteLine("ddddddddd");
if(Directory.Exists(GetLogPath()) == false)
Directory.CreateDirectory(GetLogPath());