コード例 #1
0
        private void Init(Model.WarningFormulaOne wfo)
        {
            var values = Enum.GetValues(typeof(Model.CompareType));

            foreach (var item in values)
            {
                this.comboBoxCompare.Items.Add(CommonUtils.CompareString((Model.CompareType)item));
            }
            this.comboBoxCompare.SelectedIndex = (int)wfo.CompareTypeInfo;

            string[] prices = new string[20];
            for (int i = 0; i < numbersZhCn.Length; i++)
            {
                prices[i]      = string.Format("买{0}价", numbersZhCn[i]);
                prices[i + 10] = string.Format("卖{0}价", numbersZhCn[i]);
            }

            foreach (var item in prices)
            {
                this.comboBox1.Items.Add(item);
                this.comboBox2.Items.Add(item);
                this.comboBox3.Items.Add(item);
            }
            this.comboBox1.SelectedIndex = wfo.FirstSetting.Index + wfo.FirstSetting.Direction * 10;
            this.comboBox2.SelectedIndex = wfo.SecondSetting.Index + wfo.SecondSetting.Direction * 10;
            this.comboBox3.SelectedIndex = wfo.ThirdSetting.Index + wfo.ThirdSetting.Direction * 10;

            this.comboBoxCalType.DataSource    = new char[] { '+', '-', '*', '/' };
            this.comboBoxCalType.SelectedIndex = (int)wfo.ParamCalType;

            this.comboBoxLevel.DataSource    = new string[] { "黄色预警", "红色预警" };
            this.comboBoxLevel.SelectedIndex = (int)wfo.Level;

            this.comboBoxCodesType.DataSource = new string[] { "全订阅", "自定义" };;
            if (wfo.IsSubAll)
            {
                this.comboBoxCodesType.SelectedIndex = 0;
                this.rtbCodes.ReadOnly = true;
            }
            else
            {
                this.comboBoxCodesType.SelectedIndex = 1;
                if (wfo.CodeList != null)
                {
                    this.rtbCodes.Text = string.Join(",", wfo.CodeList);
                }
            }
            this.numericUpDownBig.Value       = wfo.LargeVolume;
            this.numericUpDownParam.Value     = wfo.Param;
            this.numericUpDownFrequency.Value = wfo.Frequency; //预警显示频率
        }
コード例 #2
0
        private void Init()
        {
            var values = Enum.GetValues(typeof(Model.CompareType));

            foreach (var item in values)
            {
                this.comboBoxCompare.Items.Add(CommonUtils.CompareString((Model.CompareType)item));
            }
            this.comboBoxCompare.SelectedIndex = 0;

            string[] prices = new string[20];
            for (int i = 0; i < numbersZhCn.Length; i++)
            {
                prices[i]      = string.Format("买{0}价", numbersZhCn[i]);
                prices[i + 10] = string.Format("卖{0}价", numbersZhCn[i]);
            }

            foreach (var item in prices)
            {
                this.comboBox1.Items.Add(item);
                this.comboBox2.Items.Add(item);
                this.comboBox3.Items.Add(item);
            }
            this.comboBox1.SelectedIndex = 0;
            this.comboBox2.SelectedIndex = 10;
            this.comboBox3.SelectedIndex = 10;

            this.comboBoxCalType.DataSource    = new char[] { '+', '-', '*', '/' };
            this.comboBoxCalType.SelectedIndex = 2;

            this.comboBoxLevel.DataSource    = new string[] { "黄色预警", "红色预警" };
            this.comboBoxLevel.SelectedIndex = 0;

            this.comboBoxCodesType.DataSource = new string[] { "全订阅", "自定义" };
            comboBoxCodesType.SelectedIndex   = 0;

            this.numericUpDownFrequency.Value = 60;
            //this.numericUpDownParam.Value = (decimal)0.01;
        }