当前位置: 首页>>代码示例>>C#>>正文


C# Proxy.AssembleDocument方法代码示例

本文整理汇总了C#中System.Proxy.AssembleDocument方法的典型用法代码示例。如果您正苦于以下问题:C# Proxy.AssembleDocument方法的具体用法?C# Proxy.AssembleDocument怎么用?C# Proxy.AssembleDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Proxy的用法示例。


在下文中一共展示了Proxy.AssembleDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AssembleDocument

        /// <summary>
        /// <c>AssembleDocument</c> assembles (creates) a document from the given template, answers and settings.
        /// </summary>
        /// <param name="template">An instance of the Template class, from which the document will be assembled.</param>
        /// <param name="answers">The set of answers that will be applied to the template to assemble the document</param>
        /// <param name="settings">settings that will be used to assemble the document. 
        /// These settings include the assembled document format (file extension), markup syntax, how to display fields with unanswered variables, etc</param>
        /// <param name="logRef">A string to display in logs related to this request.</param>
        /// <returns>returns information about the assembled document, the document type, the unanswered variables, the resulting answers, etc.</returns>
        public AssembleDocumentResult AssembleDocument(Template template, TextReader answers, AssembleDocumentSettings settings, string logRef)
        {
            // Validate input parameters, creating defaults as appropriate.
            string logStr = logRef == null ? string.Empty : logRef;

            if (template == null)
                throw new ArgumentNullException("template", string.Format(@"WebService.Services.AssembleDocument: the ""template"" parameter passed in was null, logRef: {0}", logStr));

            if (settings == null)
                settings = new AssembleDocumentSettings();

            AssembleDocumentResult result = null;
            AssemblyResult asmResult = null;

            using (Proxy client = new Proxy(_endPointName))
            {
                OutputFormat outputFormat = ConvertFormat(settings.Format);
                AssemblyOptions assemblyOptions = ConvertOptions(settings);
                string fileName = GetRelativePath(template.GetFullPath());
                asmResult = client.AssembleDocument(
                    fileName,
                    answers == null ? null : new BinaryObject[] { Util.GetBinaryObjectFromTextReader(answers) }, // answers
                    outputFormat,
                    assemblyOptions,
                    null);
                SafeCloseClient(client, logRef);
            }

            if (asmResult != null)
            {
                result = Util.ConvertAssemblyResult(template, asmResult, settings.Format);
            }

            return result;
        }
开发者ID:W800RDY,项目名称:hotdocs-open-sdk,代码行数:44,代码来源:WebService.Services.cs


注:本文中的System.Proxy.AssembleDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。