예제 #1
0
 public void Init(CodePeriodListChooser codePackageInfo)
 {
     this.codePackageInfo = codePackageInfo;
     this.tbStart.Text    = this.codePackageInfo.Start.ToString();
     this.tbEnd.Text      = this.codePackageInfo.End.ToString();
     this.RefreshGrid(codePackageInfo);
 }
예제 #2
0
        private void InitCodePackage(ChartComponent chartComponent)
        {
            IDataPackage_Code     dataPackage     = chartComponent.Controller.CurrentNavigater.DataPackage;
            CodePeriodListChooser codePackageInfo = new CodePeriodListChooser();

            codePackageInfo.Codes.Add(dataPackage.Code);
            codePackageInfo.Start = dataPackage.StartDate;
            codePackageInfo.End   = dataPackage.EndDate;
            this.compCodePackage1.Init(codePackageInfo);
        }
예제 #3
0
파일: FormMain.cs 프로젝트: wanwei/sc2
        private void btCodePackage_Click(object sender, EventArgs e)
        {
            CodePeriodListChooser codePackage = new CodePeriodListChooser();

            codePackage.Start            = 20160101;
            codePackage.End              = 20170101;
            codePackage.CodeChooseMethod = CodeChooseMethod.Maincontract;
            codePackage.Codes.Add("RB");
            FormCodePackage form   = new FormCodePackage(codePackage);
            DialogResult    result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                MessageBox.Show(codePackage.ToString());
            }
        }
예제 #4
0
        public void TestCodePackageCreate_Catelog()
        {
            CodePeriodListChooser codePackageInfo = new CodePeriodListChooser();

            codePackageInfo.CodeChooseMethod = CodeChooseMethod.Catelog;
            codePackageInfo.Codes.Add("RB");
            codePackageInfo.Codes.Add("M");
            codePackageInfo.Codes.Add("A");
            codePackageInfo.Start = 20170101;
            codePackageInfo.End   = 20180101;

            IDataReader       dataReader  = TestDataCenter.Instance.DataReader;
            CodePeriodFactory fac         = new CodePeriodFactory(dataReader);
            ICodePeriodList   codePackage = fac.CreateCodePeriodList(codePackageInfo);

            Console.WriteLine(codePackage);
        }
예제 #5
0
        public void TestCodePackageCreate_Normal()
        {
            CodePeriodListChooser codePackageInfo = new CodePeriodListChooser();

            codePackageInfo.CodeChooseMethod = CodeChooseMethod.Normal;
            codePackageInfo.Codes.Add("RB1705");
            codePackageInfo.Codes.Add("RB1709");
            codePackageInfo.Codes.Add("RB1801");
            codePackageInfo.Start = 20170101;
            codePackageInfo.End   = 20180101;

            IDataReader       dataReader  = TestDataCenter.Instance.DataReader;
            CodePeriodFactory fac         = new CodePeriodFactory(dataReader);
            ICodePeriodList   codePackage = fac.CreateCodePeriodList(codePackageInfo);

            Assert.AreEqual(3, codePackage.CodePeriods.Count);
            Assert.AreEqual(20170101, codePackage.CodePeriods[0].StartDate);
        }
예제 #6
0
 public FormCodePackageSelected(CodePeriodListChooser codePackageInfo)
 {
     InitializeComponent();
     this.codeTree1.MultiSelect = true;
     this.codeTree1.Init();
     this.codePackageInfo = codePackageInfo;
     if (this.codePackageInfo.CodeChooseMethod == CodeChooseMethod.Maincontract)
     {
         this.cbChooseType.SelectedIndex = 2;
     }
     else if (this.codePackageInfo.CodeChooseMethod == CodeChooseMethod.Catelog)
     {
         this.cbChooseType.SelectedIndex = 1;
     }
     else
     {
         this.cbChooseType.SelectedIndex = 0;
     }
 }
예제 #7
0
        private void RefreshGrid(CodePeriodListChooser codePackageInfo)
        {
            string title = "合约";

            if (codePackageInfo.CodeChooseMethod == CodeChooseMethod.Maincontract)
            {
                title = "主合约品种";
            }
            else if (codePackageInfo.CodeChooseMethod == CodeChooseMethod.Catelog)
            {
                title = "品种";
            }
            this.gridCodes.Columns[0].HeaderText = title;
            this.gridCodes.Rows.Clear();
            for (int i = 0; i < codePackageInfo.Codes.Count; i++)
            {
                this.gridCodes.Rows.Add(codePackageInfo.Codes[i]);
            }
        }
예제 #8
0
 public FormStrategy(CodePeriodListChooser codePackageInfo, IStrategyData strategyData, IStrategyDrawer drawer)
 {
     this.codePackageInfo = codePackageInfo;
     this.strategyData    = strategyData;
 }
예제 #9
0
 private void btOK_Click(object sender, EventArgs e)
 {
     this.codePackageInfo = this.compCodePackage1.CodePackage;
     this.DialogResult    = DialogResult.OK;
     this.Close();
 }
예제 #10
0
 private void Init(CodePeriodListChooser dataPackageInfo)
 {
     this.compCodePackage1.Init(dataPackageInfo);
 }
예제 #11
0
 public FormCodePackage(CodePeriodListChooser codePackageInfo)
 {
     InitializeComponent();
     this.codePackageInfo = codePackageInfo;
     this.Init(codePackageInfo);
 }