コード例 #1
0
ファイル: MsMkt.cs プロジェクト: zdomokos/MetaStockDb
        private void LoadDailyData(int?fjd, int?ljd)
        {
            _dlyList = new MsMktList();
            if (File.Exists(_datFilePath))
            {
                bool flag = false;
                if (!fjd.HasValue && !ljd.HasValue)
                {
                    flag = true;
                }
                else
                {
                    if (!fjd.HasValue)
                    {
                        fjd = new int?(-99999);
                    }
                    if (!ljd.HasValue)
                    {
                        ljd = new int?(99999);
                    }
                }

                _fs = new FileStream(_datFilePath, FileMode.Open, FileAccess.Read, FileShare.None);
                if (_fs.Length > 0L)
                {
                    _baseRec = new RecMsDay();
                    int num = (int)(_fs.Length / 28L) - 1;
                    ReadFromFileStream(_fs, ref _baseRec);
                    for (int index = 0; index < num; ++index)
                    {
                        RecMktDay day = new RecMktDay();
                        ReadFromFileStream(_fs, ref day.msd);
                        day.MakeDtd();
                        if (!flag)
                        {
                            int d1              = day.dtd.d;
                            int?nullable        = fjd;
                            int valueOrDefault1 = nullable.GetValueOrDefault();
                            if ((d1 >= valueOrDefault1 ? (nullable.HasValue ? 1 : 0) : 0) != 0)
                            {
                                int d2 = day.dtd.d;
                                nullable = ljd;
                                int valueOrDefault2 = nullable.GetValueOrDefault();
                                if ((d2 <= valueOrDefault2 ? (nullable.HasValue ? 1 : 0) : 0) == 0)
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }

                        _dlyList.Add(ref day);
                    }
                }

                _fs.Close();
                _dlyList.Reset();
            }

            _loaded = true;
        }