Пример #1
0
        public void GenerateList()
        {
            AllPkgTexts.GenerateListHelper0 generateListHelper = new AllPkgTexts.GenerateListHelper0();
            IEnumerable <PkgListEntry>      source             = Form1.RecvPkgListEntries();

            generateListHelper.D2PkgDir = Form1.RecD2PkgDir();
            string text = Form1.RecAllTextDbFile();

            generateListHelper.PkgStreamList = new List <PkgStream>();
            Parallel.ForEach <PkgListEntry>(source, new Action <PkgListEntry>(generateListHelper.GenerateList0));
            List <TextResult> textResults = new PkgText(generateListHelper.PkgStreamList).GetTextResults2();

            Helpers.FileExistsDelete(text);
            File.WriteAllText(text, JsonConvert.SerializeObject(textResults));
        }
Пример #2
0
        public void GenerateList()
        {
            AllPkgTexts.GenerateListHelper0 generateListHelper = new AllPkgTexts.GenerateListHelper0();
            IEnumerable <PkgListEntry>      source             = Form1.RecvPkgListEntries();

            generateListHelper.D2PkgDir = Form1.RecD2PkgDir();
            string text = Form1.RecAllTextDbFile();

            generateListHelper.PkgStreamList = new List <PkgStream>();
            Parallel.ForEach <PkgListEntry>(source, new Action <PkgListEntry>(generateListHelper.GenerateList0));
            List <TextResult> textResults = new PkgText(generateListHelper.PkgStreamList).GetTextResults2();

            Helpers.FileExistsDelete(text);

            File.WriteAllText(text, JsonSerializer.Serialize <List <TextResult> >(textResults, new JsonSerializerOptions
            {
                IncludeFields = true,
                WriteIndented = true
            }));
        }