示例#1
0
        private void TestInstrumentsSaveLoad(string uri)
        {
            IDataStore dataStore = DataStoreFactory.CreateDataStore(uri);

            ICodeStore store = dataStore.CreateInstrumentStore();

            List <CodeInfo> codes = MockDataLoader.GetAllInstruments();

            store.Save(codes);

            List <CodeInfo> codes2 = store.Load();

            AssertUtils.AssertEqual_List_ToString(codes, codes2);
            store.Delete();
        }
示例#2
0
文件: CodeReader.cs 项目: wanwei/sc2
        private void init()
        {
            List <CodeInfo> codeInfos = instrumentStore.Load();

            for (int i = 0; i < codeInfos.Count; i++)
            {
                CodeInfo codeInfo = codeInfos[i];
                codes.Add(codeInfo);
                dicCodes.Add(codeInfo.Code.ToUpper(), codeInfo);
                String catelog = codeInfo.Catelog;
                if (!catelogs.Contains(catelog))
                {
                    catelogs.Add(catelog);
                }
                String code = codeInfo.Code;
                AddDicCodeCatelog(code, catelog);
            }
        }