コード例 #1
0
        private async Task Process(TmExporter tmExporter, TmImporter tmImporter, ModelBuilder modelBuilder, FragmentAligner fragmentAligner)
        {
            try
            {
                tmExporter.OnProgressChanged      += tmExporter_OnProgressChanged;
                tmImporter.OnProgressChanged      += tmImporter_OnProgressChanged;
                modelBuilder.OnProgressChanged    += modelBuilder_OnProgressChanged;
                fragmentAligner.OnProgressChanged += fragmentAligner_OnProgressChanged;


                var exportFullPath = await tmExporter.Export();

                await tmImporter.Import(exportFullPath);

                File.Delete(exportFullPath);

                await modelBuilder.BuildTranslationModel();

                await fragmentAligner.AlignTranslationUnits();
            }
            finally
            {
                tmExporter.OnProgressChanged      -= tmExporter_OnProgressChanged;
                tmImporter.OnProgressChanged      -= tmImporter_OnProgressChanged;
                modelBuilder.OnProgressChanged    -= modelBuilder_OnProgressChanged;
                fragmentAligner.OnProgressChanged -= fragmentAligner_OnProgressChanged;
            }
        }
コード例 #2
0
        public Task Run()
        {
            var tmExporter      = new TmExporter(FileBasedTmIn, TotalUnits);
            var tmImporter      = new TmImporter(FileBasedTmOut, TotalUnits);
            var modelBuilder    = new ModelBuilder(FileBasedTmOut);
            var fragmentAligner = new FragmentAligner(FileBasedTmOut, QuickAlign);

            if (FileBasedTmIn.FGASupport != FGASupport.NonAutomatic)
            {
                return(Process(modelBuilder,
                               fragmentAligner));
            }
            else
            {
                return(Process(tmExporter,
                               tmImporter,
                               modelBuilder,
                               fragmentAligner));
            }
        }