initial commit

This commit is contained in:
2017-01-14 00:58:33 +09:00
commit a98bc38ff0
17 changed files with 1184 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
bin/
obj/

6
App.config Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

314
AutoSeller.Designer.cs generated Normal file
View File

@@ -0,0 +1,314 @@
namespace AutoSeller
{
partial class AutoSeller
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.materialContextMenuStrip1 = new MaterialSkin.Controls.MaterialContextMenuStrip();
this.materialTabSelector1 = new MaterialSkin.Controls.MaterialTabSelector();
this.materialTabControl1 = new MaterialSkin.Controls.MaterialTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lvList = new System.Windows.Forms.ListView();
this.chCodeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chCurPrice = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chBookValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chCapitalGains = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chAssessedValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chValuation = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Yield = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tbLog = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.materialLabel2 = new MaterialSkin.Controls.MaterialLabel();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.lvCurPrice = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.materialTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// materialContextMenuStrip1
//
this.materialContextMenuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.materialContextMenuStrip1.Depth = 0;
this.materialContextMenuStrip1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialContextMenuStrip1.Name = "materialContextMenuStrip1";
this.materialContextMenuStrip1.Size = new System.Drawing.Size(61, 4);
//
// materialTabSelector1
//
this.materialTabSelector1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.materialTabSelector1.BaseTabControl = this.materialTabControl1;
this.materialTabSelector1.Depth = 0;
this.materialTabSelector1.Location = new System.Drawing.Point(0, 64);
this.materialTabSelector1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialTabSelector1.Name = "materialTabSelector1";
this.materialTabSelector1.Size = new System.Drawing.Size(1003, 49);
this.materialTabSelector1.TabIndex = 1;
this.materialTabSelector1.Text = "materialTabSelector1";
//
// materialTabControl1
//
this.materialTabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.materialTabControl1.Controls.Add(this.tabPage1);
this.materialTabControl1.Controls.Add(this.tabPage2);
this.materialTabControl1.Depth = 0;
this.materialTabControl1.Location = new System.Drawing.Point(3, 116);
this.materialTabControl1.MouseState = MaterialSkin.MouseState.HOVER;
this.materialTabControl1.Name = "materialTabControl1";
this.materialTabControl1.SelectedIndex = 0;
this.materialTabControl1.Size = new System.Drawing.Size(997, 571);
this.materialTabControl1.TabIndex = 2;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.splitContainer2);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(989, 545);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Items";
this.tabPage1.UseVisualStyleBackColor = true;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.lvList);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tbLog);
this.splitContainer1.Size = new System.Drawing.Size(738, 539);
this.splitContainer1.SplitterDistance = 375;
this.splitContainer1.TabIndex = 1;
//
// lvList
//
this.lvList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chCodeName,
this.chCurPrice,
this.chBookValue,
this.chCount,
this.chCapitalGains,
this.chAssessedValue,
this.chValuation,
this.Yield});
this.lvList.Dock = System.Windows.Forms.DockStyle.Fill;
this.lvList.Location = new System.Drawing.Point(0, 0);
this.lvList.Name = "lvList";
this.lvList.Size = new System.Drawing.Size(738, 375);
this.lvList.TabIndex = 0;
this.lvList.UseCompatibleStateImageBehavior = false;
this.lvList.View = System.Windows.Forms.View.Details;
//
// chCodeName
//
this.chCodeName.Text = "종목명";
//
// chCurPrice
//
this.chCurPrice.Text = "현재가";
//
// chBookValue
//
this.chBookValue.Text = "장부가";
//
// chCount
//
this.chCount.Text = "잔고수량";
//
// chCapitalGains
//
this.chCapitalGains.Text = "손익단가";
//
// chAssessedValue
//
this.chAssessedValue.Text = "평가금액";
//
// chValuation
//
this.chValuation.Text = "평가손익";
//
// Yield
//
this.Yield.Text = "수익률";
//
// tbLog
//
this.tbLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.tbLog.Location = new System.Drawing.Point(0, 0);
this.tbLog.Multiline = true;
this.tbLog.Name = "tbLog";
this.tbLog.Size = new System.Drawing.Size(738, 160);
this.tbLog.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.materialLabel2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(776, 545);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Preference";
this.tabPage2.UseVisualStyleBackColor = true;
//
// materialLabel2
//
this.materialLabel2.AutoSize = true;
this.materialLabel2.Depth = 0;
this.materialLabel2.Font = new System.Drawing.Font("Roboto", 11F);
this.materialLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.materialLabel2.Location = new System.Drawing.Point(339, 156);
this.materialLabel2.MouseState = MaterialSkin.MouseState.HOVER;
this.materialLabel2.Name = "materialLabel2";
this.materialLabel2.Size = new System.Drawing.Size(108, 19);
this.materialLabel2.TabIndex = 0;
this.materialLabel2.Text = "materialLabel2";
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.IsSplitterFixed = true;
this.splitContainer2.Location = new System.Drawing.Point(3, 3);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.lvCurPrice);
this.splitContainer2.Size = new System.Drawing.Size(983, 539);
this.splitContainer2.SplitterDistance = 738;
this.splitContainer2.TabIndex = 2;
this.splitContainer2.SizeChanged += new System.EventHandler(this.splitContainer2_SizeChanged);
//
// lvCurPrice
//
this.lvCurPrice.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3});
this.lvCurPrice.Dock = System.Windows.Forms.DockStyle.Fill;
this.lvCurPrice.Location = new System.Drawing.Point(0, 0);
this.lvCurPrice.Name = "lvCurPrice";
this.lvCurPrice.Size = new System.Drawing.Size(241, 539);
this.lvCurPrice.TabIndex = 0;
this.lvCurPrice.UseCompatibleStateImageBehavior = false;
this.lvCurPrice.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "매도잔량";
this.columnHeader1.Width = 96;
//
// columnHeader2
//
this.columnHeader2.Text = "호가";
this.columnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// columnHeader3
//
this.columnHeader3.Text = "매수잔량";
this.columnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.columnHeader3.Width = 81;
//
// Material
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1003, 690);
this.Controls.Add(this.materialTabSelector1);
this.Controls.Add(this.materialTabControl1);
this.Name = "Material";
this.Text = "Material";
this.materialTabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private MaterialSkin.Controls.MaterialContextMenuStrip materialContextMenuStrip1;
private MaterialSkin.Controls.MaterialTabSelector materialTabSelector1;
private MaterialSkin.Controls.MaterialTabControl materialTabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private MaterialSkin.Controls.MaterialLabel materialLabel2;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ListView lvList;
private System.Windows.Forms.ColumnHeader chCodeName;
private System.Windows.Forms.ColumnHeader chCurPrice;
private System.Windows.Forms.ColumnHeader chBookValue;
private System.Windows.Forms.ColumnHeader chCount;
private System.Windows.Forms.ColumnHeader chCapitalGains;
private System.Windows.Forms.ColumnHeader chAssessedValue;
private System.Windows.Forms.ColumnHeader chValuation;
private System.Windows.Forms.ColumnHeader Yield;
private System.Windows.Forms.TextBox tbLog;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.ListView lvCurPrice;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
}
}

37
AutoSeller.cs Normal file
View File

@@ -0,0 +1,37 @@
using MaterialSkin;
using MaterialSkin.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoSeller
{
public partial class AutoSeller : MaterialForm
{
int m_iCurPricePanelWith;
public AutoSeller()
{
InitializeComponent();
m_iCurPricePanelWith = splitContainer2.Panel2.Width;
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
}
private void splitContainer2_SizeChanged(object sender, EventArgs e)
{
int iDist = Math.Min(Math.Max(splitContainer2.Width-m_iCurPricePanelWith, splitContainer2.Panel1MinSize), splitContainer2.Width-splitContainer2.Panel2MinSize); ;
splitContainer2.SplitterDistance = iDist;
}
}
}

162
AutoSeller.csproj Normal file
View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D22B6894-B97F-4B53-92D3-D2B77FC929D5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AutoSeller</RootNamespace>
<AssemblyName>AutoSeller</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MaterialSkin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\MaterialSkin.0.2.1\lib\MaterialSkin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CybosHelper.cs" />
<Compile Include="AutoSeller.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AutoSeller.Designer.cs">
<DependentUpon>AutoSeller.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Util.cs" />
<EmbeddedResource Include="AutoSeller.resx">
<DependentUpon>AutoSeller.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<COMReference Include="CPFOREDIBLIB">
<Guid>{ABA39D6F-5AF4-4D10-8389-031055C13A75}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPFORETRADELib">
<Guid>{1E3BC2CB-4AC7-46BB-AF63-11DEA8628E3C}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CpIndexesLib">
<Guid>{3DC4496B-C823-4440-ABD4-A248A716F7C6}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPSYSDIBLib">
<Guid>{9C31B76A-7189-49A3-9781-3C6DD6ED5AD3}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPTRADELib">
<Guid>{1F7D5E5A-05AB-4236-B6F3-3D383B09203A}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="CPUTILLib">
<Guid>{2DA9C35C-FE59-4A32-A942-325EE8A6F659}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="DSCBO1Lib">
<Guid>{859343F1-08FD-11D4-8231-00105A7C4F8C}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

123
AutoSeller.resx Normal file
View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="materialContextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

22
AutoSeller.sln Normal file
View File

@@ -0,0 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoSeller", "AutoSeller.csproj", "{D22B6894-B97F-4B53-92D3-D2B77FC929D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D22B6894-B97F-4B53-92D3-D2B77FC929D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

85
CybosHelper.cs Normal file
View File

@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AutoSeller
{
class CybosHelper
{
CPUTILLib.CpCybos m_CPCybos = new CPUTILLib.CpCybos();
CPFORETRADELib.CpForeTdUtil m_CPUtil = new CPFORETRADELib.CpForeTdUtil();
DSCBO1Lib.CpConclusion m_CpConclusion = new DSCBO1Lib.CpConclusion();
bool m_bInitialized = false;
public CybosHelper()
{
short iResult = m_CPUtil.TradeInit();
switch(iResult)
{
case -1:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 오류");
break;
case 0:
m_bInitialized = true;
Util.Log(Util.LOG_TYPE.VERVOSE, "[TradeInit] 로그인 되었습니다");
break;
case 1:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 업무 키 입력 잘못됨");
break;
case 2:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 계좌 비밀번호가 잘못되었습니다");
break;
case 3:
Util.Log(Util.LOG_TYPE.ERROR, "[TradeInit] 취소되었습니다");
break;
}
string strAccount = m_CPUtil.AccountNumber[0];
m_CpConclusion.Received += CpConclusion_Received;
m_CpConclusion.Subscribe();
}
public string[] GetAccounts()
{
return m_CPUtil.AccountNumber;
}
private void CpConclusion_Received()
{
string strCodeName = m_CpConclusion.GetHeaderValue(2);
int iCount = m_CpConclusion.GetHeaderValue(3);
int iPrice = m_CpConclusion.GetHeaderValue(4);
string strBuyOrSell = m_CpConclusion.GetHeaderValue(12);
string strType = m_CpConclusion.GetHeaderValue(14);
string strCancel = m_CpConclusion.GetHeaderValue(16);
int iBookValue = m_CpConclusion.GetHeaderValue(21);
}
public int GetLimitRemainCountTrade()
{
return m_CPCybos.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_TRADE_REQUEST);
}
public int GetLimitRemainCountRQ()
{
return m_CPCybos.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_NONTRADE_REQUEST);
}
public int GetLimitRemainCountSB()
{
return m_CPCybos.GetLimitRemainCount(CPUTILLib.LIMIT_TYPE.LT_SUBSCRIBE);
}
public bool IsConnected()
{
return (m_CPCybos.IsConnect==1);
}
}
}

22
Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoSeller
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new AutoSeller());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AutoSeller")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AutoSeller")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d22b6894-b97f-4b53-92d3-d2b77fc929d5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

71
Properties/Resources.Designer.cs generated Normal file
View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AutoSeller.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoSeller.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

117
Properties/Resources.resx Normal file
View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
Properties/Settings.Designer.cs generated Normal file
View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AutoSeller.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

146
Util.cs Normal file
View File

@@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AutoSeller
{
static class Util
{
public enum LOG_TYPE
{
DEBUG,
ERROR,
VERVOSE,
NEGATIVE,
POSITIVE,
MANUAL_KEYWORD,
MANUAL_CODE,
DUPLICATED,
DENIAL,
BUY,
}
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;
}
public static void Clear()
{
m_LogBox = null;
}
static void InsertLog(RichTextBox LogBox, LOG_TYPE enType, string strLog)
{
if(LogBox.InvokeRequired)
{
LogBox.Invoke(m_InsertLogDelegate, LogBox, enType, strLog);
}
else
{
Color LogColor;
switch(enType)
{
case LOG_TYPE.DEBUG:
LogColor = Color.Gray;
break;
case LOG_TYPE.ERROR:
LogColor = Color.DarkRed;
break;
case LOG_TYPE.VERVOSE:
LogColor = Color.Black;
break;
case LOG_TYPE.NEGATIVE:
case LOG_TYPE.DENIAL:
case LOG_TYPE.DUPLICATED:
LogColor = Color.Blue;
break;
case LOG_TYPE.POSITIVE:
case LOG_TYPE.MANUAL_KEYWORD:
case LOG_TYPE.BUY:
LogColor = Color.Red;
break;
default:
LogColor = Color.Black;
break;
}
LogBox.SelectionStart = LogBox.TextLength;
LogBox.SelectionLength = 0;
LogBox.SelectionColor = LogColor;
LogBox.AppendText(strLog);
LogBox.SelectionColor = LogBox.ForeColor;
LogBox.SelectionStart = LogBox.TextLength;
LogBox.ScrollToCaret();
}
}
public static void Log(LOG_TYPE enType, string strLog)
{
if(Directory.Exists(GetLogPath()) == false)
Directory.CreateDirectory(GetLogPath());
if(m_strLogFile == null)
{
string strToday = DateTime.Now.ToString("yyyy-MM-dd");
m_strLogFile = GetLogPath()+"/"+strToday+".txt";
}
string strLogLevel = "["+enType+"] ";
string strTime = DateTime.Now.ToString("[HH:mm:ss:fff] ");
string strMessage = strTime+strLogLevel+strLog;
File.AppendAllText(m_strLogFile, strMessage+Environment.NewLine, new UTF8Encoding(true));
if(m_LogBox != null)
InsertLog(m_LogBox, enType, strMessage+Environment.NewLine);
Console.WriteLine(strMessage);
}
public static bool IsDebugging()
{
return Debugger.IsAttached;
}
public static string GetConfigPath()
{
string strPath = "";
if(IsDebugging())
strPath = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory()));
else
strPath = Directory.GetCurrentDirectory();
strPath += "/configure";
if(Directory.Exists(strPath) == false)
Directory.CreateDirectory(strPath);
return strPath;
}
public static string GetLogPath()
{
string strPath = "";
if(IsDebugging())
strPath = Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory()));
else
strPath = Directory.GetCurrentDirectory();
strPath += "/log";
return strPath;
}
}
}

4
packages.config Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MaterialSkin" version="0.2.1" targetFramework="net452" />
</packages>

Binary file not shown.