public static Command Create()
        {
            var command = new Command(
                name: "complete",
                description: "Complete the language file");

            command.AddArgument(new Argument <string>("language")
            {
                Description = "language to complete"
            });

            command.AddOption(new Option("-rewrite", "Rewrite the file"));

            command.Handler = CommandHandler.Create <string, bool>((language, rewrite) =>
            {
                IWordWriter writer = rewrite ? new ReWordWriter() : new WordWriter();

                var completeCommand = new CompleteCommand(
                    new LanguageFileParser(new Mapper(new LanguageBuilder())),
                    new WordComparer(),
                    writer);
                completeCommand.CompleteFile(language);
            });

            return(command);
        }
Esempio n. 2
0
        public TranslationManager()
        {
            wordReader = WordReaderFactory.GetCurrentInstance();
            wordWriter = WordWriterFactory.GetCurrentInstance();
            translatorCreator = new TranslatorCreator();

            ConfigureObjects();
            ConfigureThreadPool();
        }
Esempio n. 3
0
        public TranslationManager(IWordReader wordReader,
            IWordWriter wordWriter, ITranslatorCreator translatorCreator)
        {
            this.wordReader = wordReader;
            this.wordWriter = wordWriter;
            this.translatorCreator = translatorCreator;

            ConfigureObjects();
            ConfigureThreadPool();
        }
Esempio n. 4
0
        public static IWordWriter GetCurrentInstance()
        {
            if (currentWordWriter == null)
            {
                lock (syncRoot)
                {
                    if (currentWordWriter == null)
                    {
                        ConfigureWordReaderType();
                        currentWordWriter = ActiveteInstance();
                    }
                }
            }

            return currentWordWriter;
        }
        public bool Render(Microsoft.ReportingServices.OnDemandReportRendering.Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, ref Hashtable someProps, CreateAndRegisterStream createAndRegisterStream)
        {
            double pageHeight = double.MaxValue;

            using (Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing sPBProcessing = new Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing(report, createAndRegisterStream, pageHeight))
            {
                DeviceInfo deviceInfo2 = new DeviceInfo(deviceInfo);
                SPBContext sPBContext  = new SPBContext();
                sPBContext.StartPage                = 0;
                sPBContext.EndPage                  = 0;
                sPBContext.MeasureItems             = false;
                sPBContext.AddSecondaryStreamNames  = true;
                sPBContext.AddToggledItems          = deviceInfo2.ExpandToggles;
                sPBContext.AddFirstPageHeaderFooter = true;
                sPBProcessing.SetContext(sPBContext);
                using (IWordWriter writer = NewWordWriter())
                {
                    WordRenderer wordRenderer = NewWordRenderer(createAndRegisterStream, deviceInfo2, sPBProcessing, writer, report.Name);
                    try
                    {
                        return(wordRenderer.Render());
                    }
                    catch (ReportRenderingException)
                    {
                        throw;
                    }
                    catch (Exception ex2)
                    {
                        if (AsynchronousExceptionDetection.IsStoppingException(ex2))
                        {
                            throw;
                        }
                        throw new ReportRenderingException(ex2, unexpected: true);
                    }
                }
            }
        }
 internal WordOpenXmlRenderer(CreateAndRegisterStream createAndRegisterStream, Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing spbProcessing, IWordWriter writer, DeviceInfo deviceInfo, string reportName)
     : base(createAndRegisterStream, spbProcessing, writer, deviceInfo, reportName)
 {
 }
 protected override WordRenderer NewWordRenderer(CreateAndRegisterStream createAndRegisterStream, DeviceInfo deviceInfoObj, Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing spbProcessing, IWordWriter writer, string reportName)
 {
     return(new Word97Renderer(createAndRegisterStream, spbProcessing, writer, deviceInfoObj, reportName));
 }
 public WordOpenXmlRenderer(CreateAndRegisterStream createAndRegisterStream, AspNetCore.ReportingServices.Rendering.SPBProcessing.SPBProcessing spbProcessing, IWordWriter writer, DeviceInfo deviceInfo, string reportName)
     : base(createAndRegisterStream, spbProcessing, writer, deviceInfo, reportName)
 {
 }
 protected abstract WordRenderer NewWordRenderer(CreateAndRegisterStream createAndRegisterStream, DeviceInfo deviceInfoObj, Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing spbProcessing, IWordWriter writer, string reportName);
 public CompleteCommand(ILanguageFileParser parser, IWordComparer wordComparer, IWordWriter wordWriter)
 {
     _parser       = parser ?? throw new ArgumentNullException(nameof(parser));;
     _wordComparer = wordComparer ?? throw new ArgumentNullException(nameof(wordComparer));
     _wordWriter   = wordWriter ?? throw new ArgumentNullException(nameof(wordWriter));
 }