コード例 #1
0
 /// <summary>
 /// Runs the template using the specified <paramref name="model"/>.
 /// </summary>
 /// <param name="templateRunner"></param>
 /// <param name="model"></param>
 /// <param name="viewBag"></param>
 /// <returns></returns>
 public static string Run <TModel>(this ITemplateRunner <TModel> templateRunner, TModel model, DynamicViewBag viewBag = null)
 {
     using (var textWriter = new StringWriter())
     {
         templateRunner.Run(model, textWriter, viewBag);
         return(textWriter.ToString());
     }
 }
コード例 #2
0
 protected TemplateMap2
     (string attributeId,
     ITemplateRunner templateRunner,
     object template,
     string inputExtension,
     string outputFormat)
 {
     AttributeIdentifier = attributeId;
     TemplateRunner      = templateRunner;
     InputExtension      = RemovePeriod(inputExtension);
     OutputFormat        = outputFormat;
     Template            = template;
 }
コード例 #3
0
 public TemplateMap(string attributeIdentifier,
                    ITemplateRunner templateRunner,
                    object template,
                    string metadataDirectory,
                    string inputExtension,
                    string outputFormat,
                    string outputDirectory)
 {
     AttributeIdentifier = attributeIdentifier;
     TemplateRunner      = templateRunner;
     Template            = template;
     MetadataDirectory   = metadataDirectory;
     InputExtension      = RemovePeriod(inputExtension);
     OutputFormat        = outputFormat;
     OutputDirectory     = outputDirectory;
 }
コード例 #4
0
 public TemplateMap(string attributeIdentifier,
           ITemplateRunner templateRunner,
           object template,
           string metadataDirectory,
           string inputExtension,
           string outputFormat,
           string outputDirectory)
 {
     AttributeIdentifier = attributeIdentifier;
      TemplateRunner = templateRunner;
      Template = template;
      MetadataDirectory = metadataDirectory;
      InputExtension = RemovePeriod(inputExtension);
      OutputFormat = outputFormat;
      OutputDirectory = outputDirectory;
 }