ID

Uploaded

Status

Description

Work Items

Action

11940
by iskandersierra
Apr 10, 2012
7:50 PM

Being evaluated

This patch simply adds the property IncludeInSolution (true by default) to OutputInfo class. So when a T4Toolbox template is created it can be marked to be left out of current solution control (project inclusion, and source control). This allows to create a project with the sole purpose of holding the templates and generating a folder with an entire solution structure outside of the project holding the templates.

22469

Download

9913
by hughkelley
Jul 12, 2011
11:42 AM

Being evaluated

A rough cut at scope support for the AzMan wrapper. Minimally tested.

I built it on 10.3, though the changes should be pretty easy to merge:
- A new public variable, PolicyScopes
- a little constructor code to fill it
- an additional argument to the long-form public bool CanPerform(WindowsIdentity identity, <#= applicationEnumName #> operation, String scope)
- Changes to the wrapper methods, passing in null for scope in the short-form calls

Download

6615
by PeterLaCombJr
Sep 2, 2010
2:22 AM

Being evaluated

This is a minimal patch to add schema generation to the SQL scripts generated for a database project.

13859

Download

6526
by JamesFleming
Aug 20, 2010
5:27 AM

Being evaluated

Here is a set of templates, example project and some step by step instructions for generating class objects with data annotations and methods for saving those classes back to the repository. While I don't expect everyone to build out their projects this way, at a minimum it should be instructive to those who are looking for examples of how to customize templates to their own choosing.
While these may be too specialized for inclusion in the toolbox directly, they might be handy as an add in or download from this site. Let me know what you think!

Download

5819
by rst99
Apr 21, 2010
2:56 PM

Being evaluated

Actually, I found a better solution for my Problem #17332: As we can also use $(variableName) syntax to reference Visual Studio or MSBuild variables, I added the following additional assembly resolver code in VolatileAssemblyProcessor.ResolveAssemblyReference(string assemblyName):

// Try to resolve assembly name relative to the project output directory
try
{
assemblyPath = Host.ResolveAssemblyReference("$(ProjectDir)$(OutDir)" + assemblyName);
if (File.Exists(assemblyPath))
{
return assemblyPath;
}
}
catch (FileNotFoundException)
{
}
catch (FileLoadException)
{
}


Note: This is a replacement for my earlier posted Patch #5818

17332

Download

5818
by rst99
Apr 21, 2010
2:05 PM

Being evaluated

I fixed my problem reported in Issue #17332 with the following additional assembly resolver code in VolatileAssemblyProcessor.ResolveAssemblyReference(string assemblyName):

// Try to resolve the assembly relative to the solution base path
try
{
Solution solution = GetDte().Solution;
assemblyPath = Path.Combine(Path.GetDirectoryName(solution.FullName), assemblyName);
if (File.Exists(assemblyPath))
{
return assemblyPath;
}
}
catch (FileNotFoundException)
{
}
catch (FileLoadException)
{
}

To make this work, I also copied the Method GetDte() from the class DteProcessor.cs (I guess you should put that handy method in a helper or base class).

Download

3644
by danieljoubert
Aug 20, 2009
2:03 PM

Being evaluated

I have added the following to the Constructor method of the
LinqToSqlEntityClassTemplate class to make the class serializable with the Binary and Xml Serializer.

To make this work the class must inherit from the ISerializable and have the Serializable attribute.
Can you please somehow add this to the T4 Toolbox?

public <#= this.Type.Name #>(SerializationInfo info, StreamingContext context)
{
<#+
foreach(Column column in this.columns)
{
#>
<#= FieldName(column) #> = (<#= TypeName(column) #>) info.GetValue("<#= FieldName(column) #>", typeof(<#= TypeName(column) #>));
<#+
}
#>
}

<#+
}

public void RenderGetObjectData()
{
#>
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
<#+
foreach(Column column in this.columns)
{
#>
info.AddValue("<#= FieldName(column) #>", <#= FieldName(column) #>, typeof(<#= TypeName(column) #>));
<#+
}
#>
}
<#+
}

Download

2041
by ggreig
Nov 4, 2008
12:18 PM

Being evaluated

Added functions to TransformationContext.tt and Template.tt to support creating files only when they don't already exist.

This functionality can be called from a Generator to create files that won't subsequently be overwritten or deleted when regeneration occurs. A potential use of this functionality would be to generate a partial class spread across two or more files, one or more of which could then safely contain hand-coded extensions to the automatically generated class. This behaviour would be analogous to Visual Studio's creation of multiple source files for Windows or Web forms.

Download

3445
by MichaelDBang
Jul 28, 2009
2:03 PM

Applied

T4Listener Patch.


Applied Aug 5, 2009: Integrated in changeset 35884

13707

Download

3260
by softlion
Jul 7, 2009
11:31 AM

Applied

Fix for bug (on latest SNV version) "Error Running transformation: Association key is invalid. Field "xxxx" doesn't exist"

In LinqToSqlEntityClassTemplate.tt replace the content of FindColumn with the following one.
The bug is caused by the call to PropertyName(columnName) which changes the column name to a C# compatible one, and the comparison never match.
But here we just want to compare original SQL column names...

private static Column FindColumn(Type type, string columnName)
{
foreach (object item in type.Items)
{
Column column = item as Column;
if (column != null && column.Name == columnName)
{
return column;
}
}

return null;
}


Applied Jul 28, 2009: Changeset 35625.

Download

View All