- 키워드 검색, 종목 찾기 추가
- 거부종목, 중복종목, 수동종목 추가
This commit is contained in:
113
ConfigForm.cs
Normal file
113
ConfigForm.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace NewsCrawler
|
||||
{
|
||||
public partial class ConfigForm : Form
|
||||
{
|
||||
NewsForm m_Listener = null;
|
||||
|
||||
public ConfigForm(NewsForm Listener)
|
||||
{
|
||||
m_Listener = Listener;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ConfigForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
tbVolume.Text = Config.GetManualPrice().ToString();
|
||||
}
|
||||
|
||||
private void OpenFile(string strName)
|
||||
{
|
||||
string strPath = Util.GetConfigPath()+strName;
|
||||
if(File.Exists(strPath) == false)
|
||||
{
|
||||
using(var sw = new StreamWriter(File.Open(strPath, FileMode.CreateNew), new UTF8Encoding(true)))
|
||||
sw.WriteLine("");
|
||||
}
|
||||
|
||||
System.Diagnostics.Process.Start(strPath);
|
||||
}
|
||||
|
||||
#region codes
|
||||
private void btnCodeManualMake_Click(object sender, EventArgs e)
|
||||
{
|
||||
int iPrice;
|
||||
int.TryParse(tbVolume.Text, out iPrice);
|
||||
|
||||
Config.SetManualPrice(iPrice);
|
||||
m_Listener.OnManualCodeClick(iPrice);
|
||||
}
|
||||
|
||||
private void btnCodeManualEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFile("/code-manual.txt");
|
||||
}
|
||||
|
||||
private void btnDenialCodeEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFile("/code-deny.txt");
|
||||
}
|
||||
|
||||
private void btnDenialCodeApply_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_Listener.ApplyDenialCode();
|
||||
}
|
||||
|
||||
private void btnDuplicatedCodeEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFile("/code-duplicated.txt");
|
||||
}
|
||||
|
||||
private void btnDuplicatedCodeApply_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_Listener.ApplyDuplicatedCode();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Keywords
|
||||
private void btnPositiveEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFile("/keyword-positive.txt");
|
||||
}
|
||||
|
||||
private void btnPositiveApply_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_Listener.ApplyPositive();
|
||||
}
|
||||
|
||||
private void btnManualEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFile("/keyword-manual.txt");
|
||||
}
|
||||
|
||||
private void btnManualApply_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_Listener.ApplyManual();
|
||||
}
|
||||
|
||||
private void btnNegativeEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFile("/keyword-negative.txt");
|
||||
}
|
||||
|
||||
private void btnNegativeApply_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_Listener.ApplyNegative();
|
||||
}
|
||||
|
||||
private void btnSynonymEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFile("/code-synonym.txt");
|
||||
}
|
||||
|
||||
private void btnSynonymApply_Click(object sender, EventArgs e)
|
||||
{
|
||||
m_Listener.ApplySynonym();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user