Skip to content

Commit 9dba437

Browse files
author
Michael Cleverdon
committed
mcleverdon Adding documentation to RazorEngineCompilationOptionsBuilder
1 parent 64dbcd9 commit 9dba437

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

RazorEngineCore/RazorEngineCompilationOptionsBuilder.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,30 @@ public RazorEngineCompilationOptionsBuilder(RazorEngineCompilationOptions option
1515
this.Options = options ?? new RazorEngineCompilationOptions();
1616
}
1717

18+
/// <summary>
19+
/// Loads the Assembly by name and adds it to the Engine's Assembly Reference list
20+
/// </summary>
21+
/// <param name="assemblyName">Full Name of the Assembly to add to the assembly list</param>
1822
public void AddAssemblyReferenceByName(string assemblyName)
1923
{
2024
Assembly assembly = Assembly.Load(new AssemblyName(assemblyName));
2125
this.AddAssemblyReference(assembly);
2226
}
2327

28+
/// <summary>
29+
/// Adds a loaded assembly to the Engine's Assembly Reference list
30+
/// </summary>
31+
/// <param name="assembly">Assembly to add to the assembly list</param>
2432
public void AddAssemblyReference(Assembly assembly)
2533
{
2634
this.Options.ReferencedAssemblies.Add(assembly);
2735
}
2836

37+
/// <summary>
38+
/// <para>Adds a type's assembly to the Engine's Assembly Reference list</para>
39+
/// <para>Also adds the type's GenericTypeArguments to the Reference list as well</para>
40+
/// </summary>
41+
/// <param name="type">The type who's assembly should be added to the assembly list</param>
2942
public void AddAssemblyReference(Type type)
3043
{
3144
this.AddAssemblyReference(type.Assembly);
@@ -36,16 +49,35 @@ public void AddAssemblyReference(Type type)
3649
}
3750
}
3851

52+
/// <summary>
53+
/// Adds a MetadataReference for use in the Engine's Assembly Reference generation
54+
/// </summary>
55+
/// <param name="reference">Metadata Reference to add to the Engine's Referenced Assemblies</param>
3956
public void AddMetadataReference(MetadataReference reference)
4057
{
4158
this.Options.MetadataReferences.Add(reference);
4259
}
4360

61+
/// <summary>
62+
/// <para>Adds a default <c>using</c> to the compiled view. This is equivalent to adding <c>@using [NAMESPACE]</c> to every template rendered by the engine'</para>
63+
/// Current Defaults:
64+
/// <list type="bullet">
65+
/// <listheader></listheader>
66+
/// <item>System.Linq</item>
67+
/// <item>System.Collections</item>
68+
/// <item>System.Collections.Generic</item>
69+
/// </list>
70+
/// </summary>
71+
/// <param name="namespaceName">Namespace to add to default usings</param>
4472
public void AddUsing(string namespaceName)
4573
{
4674
this.Options.DefaultUsings.Add(namespaceName);
4775
}
4876

77+
/// <summary>
78+
/// Adds type to @inherit from in the template
79+
/// </summary>
80+
/// <param name="type">Type to @inherit from</param>
4981
public void Inherits(Type type)
5082
{
5183
this.Options.Inherits = this.RenderTypeName(type);
@@ -94,6 +126,9 @@ private string RenderDeclaringType(Type type)
94126
return parent + "." + type.Name;
95127
}
96128

129+
/// <summary>
130+
/// Enables debug info
131+
/// </summary>
97132
public void IncludeDebuggingInfo()
98133
{
99134
this.Options.IncludeDebuggingInfo = true;

0 commit comments

Comments
 (0)