Exemplo n.º 1
0
        public static IDataProvider MergeOneRealtime(IDataManager idm, string Code, DataPackage dp)
        {
            CommonDataProvider provider1 = (CommonDataProvider)idm[Code];

            provider1.Merge(dp);
            provider1.SaveBinary(FileDataManager.GetFileName(Code));
            return(provider1);
        }
Exemplo n.º 2
0
        public static void MergeRealtime()
        {
            FileDataManager manager1 = new FileDataManager(null);

            foreach (DataRow row1 in StockDB.dtSymbolList.Rows)
            {
                if (!object.Equals(row1["LastTime"], row1["MergeTime"]))
                {
                    string text1 = row1["Code"].ToString().Trim();
                    row1["MergeTime"]           = row1["LastTime"];
                    StockDB.dtSymbolListChanged = true;
                    StockDB.MergeOneRealtime(manager1, text1, StockDB.GetRealtimeData(row1));
                }
            }
        }
Exemplo n.º 3
0
        private void btnScan_Click(object sender, EventArgs e)
        {
            TreeNode node1 = this.tvFormula.SelectedNode;

            if (node1 != null)
            {
                string text1 = (string)node1.Tag;
                int    num1  = 0;
                if (text1 != null)
                {
                    text1 = text1 + this.GetParam();
                    FormulaBase     base1      = FormulaBase.GetFormulaByName(text1);
                    int             num2       = base1.DataCountAtLeast();
                    FileDataManager manager1   = new FileDataManager(null);
                    string[]        textArray1 = ListForm.Current.GetSymbolList();
                    ArrayList       list1      = new ArrayList();
                    this.pbScan.Maximum = textArray1.Length;
                    this.pbScan.Visible = true;
                    if (textArray1.Length > 0)
                    {
                        string[] textArray2 = textArray1;
                        for (int num4 = 0; num4 < textArray2.Length; num4++)
                        {
                            string             text2     = textArray2[num4];
                            CommonDataProvider provider1 = (CommonDataProvider)manager1[text2, num2];
                            FormulaPackage     package1  = base1.Run(provider1);
                            FormulaData        data1     = package1[package1.Count - 1];
                            if ((data1.Length > 0) && (data1.LASTDATA > 0))
                            {
                                list1.Add(text2);
                            }
                            num1++;
                            if (((num1 % 10) == 0) || (num1 == textArray1.Length))
                            {
                                this.pbScan.Value = num1;
                                double num5 = ((double)num1) / ((double)textArray1.Length);
                                this.lMsg.Text = num1.ToString() + "(" + num5.ToString("p2") + ")";
                                Application.DoEvents();
                                if ((num1 % 100) == 0)
                                {
                                    GC.Collect();
                                }
                            }
                        }
                    }
                    StockDB.LoadFolderRow(1, text1);
                    int num3 = StockDB.GetMaxFolderId();
                    if (list1.Count > 0)
                    {
                        this.pbScan.Maximum = list1.Count;
                        num1 = 0;
                        IEnumerator enumerator1 = list1.GetEnumerator();
                        try
                        {
                            while (enumerator1.MoveNext())
                            {
                                StockDB.LoadFolderRelRow(enumerator1.Current, num3);
                                num1++;
                                if ((num1 % 100) == 0)
                                {
                                    this.pbScan.Value = num1;
                                    Application.DoEvents();
                                }
                            }
                        }
                        finally
                        {
                            IDisposable disposable1 = enumerator1 as IDisposable;
                            if (disposable1 != null)
                            {
                                disposable1.Dispose();
                            }
                        }
                    }
                    StockDB.ResetFolderDatabase();
                    ListForm.Current.FolderId = num3;
                    return;
                }
            }
            MessageBox.Show("Please select a condition!");
        }