Example #1
0
        private void buttonForAddStock_Click(object sender, EventArgs e)
        {
            var input     = Util.Input("请输入正确的股票代码:");
            var stockCode = Util.ReturnFixStockCode(input);

            if (stockCode == null)
            {
                Util.Error($"您输入的股票代码【{input}】不是正确的股票代码或已存在!");
                return;
            }
            if (StockConfig.AddStock(stockCode))
            {
                LoadStockList();
            }
        }
Example #2
0
 private void LoadSetting()
 {
     StockConfig.LoadSetting();
     maxIndex = StockConfig.StockList.Count - 1;
     if (maxIndex <= 0)
     {
         currentIndex = -1;
     }
     else if (currentIndex > maxIndex)
     {
         currentIndex = 0;
     }
     else
     {
         ++currentIndex;
     }
 }