哪位大哥有 tangible t4010 editor 破解版的破解版

1   T4语法
T4的语法与ASP.NET的方式比较类似。主要包括指令、文本块、控制块。
1.1&&& 指令
指令主要包括template, output, assembly, import, include等类型,用以告诉T4引擎如何编译和运行一个模板。这些指令相当于T4引擎的配置参数。
&#@ template debug="true" hostspecific="true" language="C#"
告诉T4引擎控制块用c#编写;
&#@ output extension=".cs" #&
告诉T4引擎生成文件的后缀名是.cs;
&#@ assembly name="System.Core"#&
告诉T4引擎编译运行时引用System.Core程序集;
&#@ assembly name="$(SolutionDir)\Project.CodeGenerator\bin\Debug\MySql.Data.Dll"
告诉T4引擎引用一个特定的位置上的程序集;
&#@ import namespace="System.Data.SqlClient"#&
告诉T4引擎编译运行时引用某个名称空间
&#@ include file="../Code/DBSchema.ttinclude"#&
告诉T4引擎编译运行时引用某个文件,类似于JS的引用
1.2 && 文本块
文本块, T4引擎会将文本块的内容直接复制到输出文件中。
1.3 && 控制块
控制块,主要用于控制文本的输出。在控制块可以写任意的C#代码。
1.4 && 示例Hello world
&#@ template debug="true" hostspecific="true" language="C#" #&
&#@ output extension=".txt" #&
Hello, &#Write("World");#&
2   工作原理
1&&&&& Step1:编译模板,根据指令编译模板中的文本块和控制块,并生成一个继承于TextTransformation的类。
2&&&&& Step2: T4引擎动态创建类的实例,并调用TransformText方法。
3  在T4中读取表结构
我们用T4时,主要是基于数据库或配置文件来生成各类的代码。所以如何有效地获取数据库的结构信息,是比较重要的。 之前看很多人直接把获取数据库的信息放在每一个模板中,在更换其它数据库时,又要重写模板。一个模板同时支持多个项目时,不同的项目数据库很有可能是不同的。
主要设计思想如下,简单地应用了简单工厂模式。通过DBSchemaFactory类根据不同数据库类型,获取数据库访问类的接口IDBSchema。最后返回相同的表结构信息。
DBSchema.ttinclude类:
根据不同的数据库,获取表结构信息。已包括SQLSERVER和MYSQL。
&#@ assembly name="System.Core"#&
&#@ assembly name="System.Data" #&
&#@ assembly name="System.xml" #&
&#@ assembly name="$(SolutionDir)\bin\Debug\MySql.Data.Dll"
&#@ import namespace="System"#&
&#@ import namespace="System.Collections.Generic"#&
&#@ import namespace="System.Data"#&
&#@ import namespace="System.Data.SqlClient"#&
&#@ import namespace="MySql.Data.MySqlClient"#&
#region Code
public class DBSchemaFactory
static readonly string DatabaseType = "SqlServer";
public static IDBSchema GetDBSchema()
IDBSchema dbS
switch (DatabaseType)
case "SqlServer":
dbSchema =new SqlServerSchema();
case "MySql":
dbSchema = new MySqlSchema();
throw new ArgumentException("The input argument of DatabaseType is invalid!");
return dbS
public interface IDBSchema : IDisposable
List&string& GetTablesList();
Table GetTableMetadata(string tableName);
public class SqlServerSchema : IDBSchema
public string ConnectionString = "Data Source=.;Initial Catalog=ProjectDPersist Security Info=TUser ID=Password=123456;";
public SqlC
public SqlServerSchema()
conn = new SqlConnection(ConnectionString);
conn.Open();
public List&string& GetTablesList()
DataTable dt = conn.GetSchema("Tables");
List&string& list = new List&string&();
foreach (DataRow row in dt.Rows)
list.Add(row["TABLE_NAME"].ToString());
public Table GetTableMetadata(string tableName)
string selectCmdText = string.Format("SELECT * FROM {0}", tableName); ;
SqlCommand command = new SqlCommand(selectCmdText, conn);
SqlDataAdapter ad = new SqlDataAdapter(command);
System.Data.DataSet ds = new DataSet();
ad.FillSchema(ds, SchemaType.Mapped, tableName);
Table table = new Table(ds.Tables[0]);
public void Dispose()
if (conn != null)
conn.Close();
public class MySqlSchema : IDBSchema
public string ConnectionString = "Server=Port=3306;Database=ProjectDUid=Pwd=;";
public MySqlC
public MySqlSchema()
conn = new MySqlConnection(ConnectionString);
conn.Open();
public List&string& GetTablesList()
DataTable dt = conn.GetSchema("Tables");
List&string& list = new List&string&();
foreach (DataRow row in dt.Rows)
list.Add(row["TABLE_NAME"].ToString());
public Table GetTableMetadata(string tableName)
string selectCmdText = string.Format("SELECT * FROM {0}", tableName); ;
MySqlCommand command = new MySqlCommand(selectCmdText, conn);
MySqlDataAdapter ad = new MySqlDataAdapter(command);
System.Data.DataSet ds = new DataSet();
ad.FillSchema(ds, SchemaType.Mapped, tableName);
Table table = new Table(ds.Tables[0]);
public void Dispose()
if (conn != null)
conn.Close();
public class Table
public Table(DataTable t)
this.PKs = this.GetPKList(t);
this.Columns = this.GetColumnList(t);
this.ColumnTypeNames = this.SetColumnNames();
public List&Column& PKs;
public List&Column& C
public string ColumnTypeN
public List&Column& GetPKList(DataTable dt)
List&Column& list = new List&Column&();
Column c = null;
if (dt.PrimaryKey.Length & 0)
list = new List&Column&();
foreach (DataColumn dc in dt.PrimaryKey)
c = new Column(dc);
list.Add(c);
private List&Column& GetColumnList(DataTable dt)
List&Column& list = new List&Column&();
Column c = null;
foreach (DataColumn dc in dt.Columns)
c = new Column(dc);
list.Add(c);
private string SetColumnNames()
List&string& list = new List&string&();
foreach (Column c in this.Columns)
list.Add(string.Format("{0} {1}", c.TypeName, c.LowerColumnName));
return string.Join(",", list.ToArray());
public class Column
DataColumn columnB
public Column(DataColumn columnBase)
this.columnBase = columnB
public string ColumnName { get { return this.columnBase.ColumnN } }
public string MaxLength { get { return this.columnBase.MaxLength.ToString(); } }
public string TypeName {
string result = string.E
if (this.columnBase.DataType.Name == "Guid")//for mysql,因为对于MYSQL如果是CHAR(36),类型自动为Guid
result = "String";
result = this.columnBase.DataType.N
public bool AllowDBNull { get { return this.columnBase.AllowDBN } }
public string UpColumnName
return string.Format("{0}{1}", this.ColumnName[0].ToString().ToUpper(), this.ColumnName.Substring(1));
public string LowerColumnName
return string.Format("{0}{1}", this.ColumnName[0].ToString().ToLower(), this.ColumnName.Substring(1));
public class GeneratorHelper
public static readonly string StringType = "String";
public static readonly string DateTimeType = "DateTime";
public static string GetQuesMarkByType(string typeName)
string result = typeN
if (typeName == DateTimeType)
result += "?";
#endregion
数据库结构的测试模板02 DBSchema.tt
输出数据库的所有表的结构信息
&#@ template debug="true" hostspecific="true" language="C#"
&#@ output extension=".txt" #&
&#@ assembly name="System.Core"#&
&#@ import namespace="System"#&
&#@ import namespace="System.Collections.Generic"#&
&#@ include file="../Code/DBSchema.ttinclude"#&
var dbSchema=DBSchemaFactory.GetDBSchema();
List&string& tableList=dbSchema.GetTablesList();
foreach(string tableName in tableList)
&#= tableName #&
Table table=dbSchema.GetTableMetadata(tableName);
foreach(Column c in table.PKs)
&#= c.ColumnName#&
ColumnName,TypeName,MaxLength,UpColumnName,LowerColumnName
foreach(Column c in table.Columns)
&#=c.ColumnName#&,&#=c.TypeName#&,&#=c.MaxLength#&,&#=c.UpColumnName#&,&#=c.LowerColumnName#&
dbSchema.Dispose();
1& 在DBSchema.ttinclude,所有的类都被包含在&#+ #&中,&#+ #&是一个类功能的控制块,其中可以定义任意的C#代码。这些类多是帮助类,所以又定义在一个可复用的模板中&.ttinclude&.
2& 在02 DBSchema.tt中有一行& &#@ include file="../Code/DBSchema.ttinclude"#&&,是指引用某个位置的文件,在这里指是引用一个可复用的模板。
4用T4生成实体
用T4生成一个代码的一个常用应用是生成实体类,下面是一个示例代码(此模板引用了DBSchema.ttinclude):
&#@ template debug="true" hostspecific="true" language="C#"
&#@ output extension=".cs" #&
&#@ assembly name="System.Core"#&
&#@ import namespace="System"#&
&#@ import namespace="System.Collections.Generic"#&
&#@ include file="../Code/DBSchema.ttinclude"#&
var dbSchema=DBSchemaFactory.GetDBSchema();
List&string& tableList=dbSchema.GetTablesList();
foreach(string tableName in tableList)
Table table=dbSchema.GetTableMetadata(tableName);
using System.Collections.G
using System.T
namespace Project.Model
[Serializable]
public class &#=tableName#&
#region Constructor
public &#=tableName#&() { }
public &#=tableName#&(&#=table.ColumnTypeNames#&)
foreach(Column c in table.Columns)
this.&#=c.LowerColumnName#& = &#=c.LowerColumnName#&;
#endregion
#region Attributes
foreach(Column c in table.Columns)
private &#=GeneratorHelper.GetQuesMarkByType(c.TypeName)#& &#=c.LowerColumnName#&;
public &#=GeneratorHelper.GetQuesMarkByType(c.TypeName)#& &#=c.UpColumnName#&
get { return &#=c.LowerColumnName#&; }
set { &#=c.LowerColumnName#& = }
#endregion
#region Validator
public List&string& ErrorList = new List&string&();
private bool Validator()
bool validatorResult = true;
foreach(Column c in table.Columns)
if(!c.AllowDBNull)
if(c.TypeName==GeneratorHelper.StringType)
if (string.IsNullOrEmpty(this.&#=c.UpColumnName#&))
validatorResult = false;
this.ErrorList.Add("The &#=c.UpColumnName#& should not be empty!");
if(c.TypeName==GeneratorHelper.DateTimeType)
if (this.&#=c.UpColumnName#&==null)
validatorResult = false;
this.ErrorList.Add("The &#=c.UpColumnName#& should not be empty!");
if(c.TypeName==GeneratorHelper.StringType)
if (this.&#=c.UpColumnName#& != null && &#=c.MaxLength#& & this.&#=c.UpColumnName#&.Length)
validatorResult = false;
this.ErrorList.Add("The length of &#=c.UpColumnName#& should not be greater then &#=c.MaxLength#&!");
return validatorR
#endregion
dbSchema.Dispose();
1&&&&& 在这个模板中,&#= #&为表达式控制块
2&&&&& 除了表达式控制块,其它的代码块的开始&#和结束符#&最好是放在行首,这样一来容易分辨,二来最终输出的文本也是你想要的,不然文本块会乱掉。
5生成多个实体并分隔成多个文件
对于同时生成多个文件的模板可以直接下面的一个帮助类,这个帮助类可以帮助我们将一个文件分隔成多个文件(网上找的)。
分隔文件的帮助类:
&#@ assembly name="System.Core"#&
&#@ assembly name="EnvDTE"#&
&#@ import namespace="System.Collections.Generic"#&
&#@ import namespace="System.IO"#&
&#@ import namespace="System.Text"#&
&#@ import namespace="Microsoft.VisualStudio.TextTemplating"#&
// T4 Template Block manager for handling multiple file outputs more easily.
// Copyright (c) Microsoft Corporation.
All rights reserved.
// This source code is made available under the terms of the Microsoft Public License (MS-PL)
// Manager class records the various blocks so it can split them up
class Manager
public struct Block {
public String N
public int Start, L
public List&Block& blocks = new List&Block&();
public Block currentB
public Block footerBlock = new Block();
public Block headerBlock = new Block();
public ITextTemplatingEngineH
public ManagementS
public StringB
public String OutputPath { get; set; }
public Manager(ITextTemplatingEngineHost host, StringBuilder template, bool commonHeader) {
this.host =
this.template =
OutputPath = String.E
strategy = ManagementStrategy.Create(host);
public void StartBlock(String name) {
currentBlock = new Block { Name = name, Start = template.Length };
public void StartFooter() {
footerBlock.Start = template.L
public void EndFooter() {
footerBlock.Length = template.Length - footerBlock.S
public void StartHeader() {
headerBlock.Start = template.L
public void EndHeader() {
headerBlock.Length = template.Length - headerBlock.S
public void EndBlock() {
currentBlock.Length = template.Length - currentBlock.S
blocks.Add(currentBlock);
public void Process(bool split) {
String header = template.ToString(headerBlock.Start, headerBlock.Length);
String footer = template.ToString(footerBlock.Start, footerBlock.Length);
blocks.Reverse();
foreach(Block block in blocks) {
String fileName = bine(OutputPath, block.Name);
if (split) {
String content = header + template.ToString(block.Start, block.Length) +
strategy.CreateFile(fileName, content);
template.Remove(block.Start, block.Length);
strategy.DeleteFile(fileName);
class ManagementStrategy
internal static ManagementStrategy Create(ITextTemplatingEngineHost host) {
return (host is IServiceProvider) ? new VSManagementStrategy(host) : new ManagementStrategy(host);
internal ManagementStrategy(ITextTemplatingEngineHost host) { }
internal virtual void CreateFile(String fileName, String content) {
File.WriteAllText(fileName, content);
internal virtual void DeleteFile(String fileName) {
if (File.Exists(fileName))
File.Delete(fileName);
class VSManagementStrategy : ManagementStrategy
private EnvDTE.ProjectItem templateProjectI
internal VSManagementStrategy(ITextTemplatingEngineHost host) : base(host) {
IServiceProvider hostServiceProvider = (IServiceProvider)
if (hostServiceProvider == null)
throw new ArgumentNullException("Could not obtain hostServiceProvider");
EnvDTE.DTE dte = (EnvDTE.DTE)hostServiceProvider.GetService(typeof(EnvDTE.DTE));
if (dte == null)
throw new ArgumentNullException("Could not obtain DTE from host");
templateProjectItem = dte.Solution.FindProjectItem(host.TemplateFile);
internal override void CreateFile(String fileName, String content) {
base.CreateFile(fileName, content);
((EventHandler)delegate { templateProjectItem.ProjectItems.AddFromFile(fileName); }).BeginInvoke(null, null, null, null);
internal override void DeleteFile(String fileName) {
((EventHandler)delegate { FindAndDeleteFile(fileName); }).BeginInvoke(null, null, null, null);
private void FindAndDeleteFile(String fileName) {
foreach(EnvDTE.ProjectItem projectItem in templateProjectItem.ProjectItems) {
if (projectItem.get_FileNames(0) == fileName) {
projectItem.Delete();
示例模板:
生成某个数据库下面所有的表的实体,并放在不同的文件里。
&#@ template debug="true" hostspecific="true" language="C#"
&#@ output extension=".cs" #&
&#@ assembly name="System.Core"#&
&#@ import namespace="System"#&
&#@ import namespace="System.Collections.Generic"#&
&#@ include file="../Code/DBSchema.ttinclude"#&
&#@ include file="../Code/MultiDocument.ttinclude"#&
&# var manager = new Manager(Host, GenerationEnvironment, true) { OutputPath = Path.GetDirectoryName(Host.TemplateFile)}; #&
var dbSchema=DBSchemaFactory.GetDBSchema();
List&string& tableList=dbSchema.GetTablesList();
foreach(string tableName in tableList)
manager.StartBlock(tableName+".cs");
Table table=dbSchema.GetTableMetadata(tableName);
using System.Collections.G
using System.T
namespace Project.Model
[Serializable]
public class &#=tableName#&
#region Constructor
public &#=tableName#&() { }
public &#=tableName#&(&#=table.ColumnTypeNames#&)
foreach(Column c in table.Columns)
this.&#=c.LowerColumnName#& = &#=c.LowerColumnName#&;
#endregion
#region Attributes
foreach(Column c in table.Columns)
private &#=GeneratorHelper.GetQuesMarkByType(c.TypeName)#& &#=c.LowerColumnName#&;
public &#=GeneratorHelper.GetQuesMarkByType(c.TypeName)#& &#=c.UpColumnName#&
get { return &#=c.LowerColumnName#&; }
set { &#=c.LowerColumnName#& = }
#endregion
#region Validator
public List&string& ErrorList = new List&string&();
private bool Validator()
bool validatorResult = true;
foreach(Column c in table.Columns)
if(!c.AllowDBNull)
if(c.TypeName==GeneratorHelper.StringType)
if (string.IsNullOrEmpty(this.&#=c.UpColumnName#&))
validatorResult = false;
this.ErrorList.Add("The &#=c.UpColumnName#& should not be empty!");
if(c.TypeName==GeneratorHelper.DateTimeType)
if (this.&#=c.UpColumnName#&==null)
validatorResult = false;
this.ErrorList.Add("The &#=c.UpColumnName#& should not be empty!");
if(c.TypeName==GeneratorHelper.StringType)
if (this.&#=c.UpColumnName#& != null && &#=c.MaxLength#& & this.&#=c.UpColumnName#&.Length)
validatorResult = false;
this.ErrorList.Add("The length of &#=c.UpColumnName#& should not be greater then &#=c.MaxLength#&!");
return validatorR
#endregion
manager.EndBlock();
dbSchema.Dispose();
manager.Process(true);
T4的编辑工具下载地址
VS默认的编辑工具无高亮,无提示,错误不易定位。 没这个工具,真心不想写任何T4代码。
所有示例代码:
阅读(...) 评论()The poster (email) is not available. 收藏推荐:
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& tangible T4 Editor v2.2.3 Pro Edition
&&&&&&&&&&& This is the full cracked version of the software. Download, extract, install, enjoy.
&& Inside the archive there is "crack" folder wich contains everything you need to crack the software.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Download link:
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& https://safelinking.net/p/5addbeb7ab
Quickly write your own .NET Code Generator via T4 Text-Templates (.tt-Files) with Intelli-Sense & Syntax-Highlighting. tangible T4 Editor comes with UML-Style modeling tools and can generate from diagrams, database schemas, xml, word, excel sources, or any other data source. Microsoft T4 looks and smells like ASP.NET - it is simple! T4 is used in ASP.NET MVC, Entity Framework and DSL Tools. The Microsoft T4 Generation Engine is already built into Visual Studio, however Visual Studio does not provide an Code-Editor for it. That is why we created the tangible T4 Editor for Visual Studio. You can now accelerate your projects by adopting Microsoft T4 today and generate the code you need directly from diagrams, database schemas, xml files or other sources - Write less, achieve more.
tangible T4 Editor features include Syntax Highlighting, Statement Completion, Error Reporting, a Template Gallery as well as Debugging features and UML-Style modeling tools.
Download this book
Free download ezdownloader, then you can free download.
使用ezdownloader下载
Copyright Disclaimer:
本站一切内容源于互联网搜索,禁止商用! 如有任何不妥请联系:,我们将在24小时内删除相关内容。
浏览量:0 添加时间: 22:54:28, 更新时间: 22:54:28, shared by
搜索该书!...
Search mirrors of "tangible T4 Editor v2.2.3 Pro Edition cracked version downlo"...
推荐:使用EZdownloader下载电子书
没有下载链接
请在图书介绍里查找下载链接,如果没有,可以试着搜索有无其它该书信息。
不能下载?如果不能下载或者在“图书介绍”中找不到 "tangible T4 Editor v2.2.3 Pro Edition cracked version downlo" 的下载链接请留言。下次访问本站时察看
看是否有人已经更新了该书。该书可能有其它下载链接,请点 。
"tangible T4 Editor v2.2.3 Pro Edition cracked version downlo" 相关链接:
Visustin v6.12 Pro Edition cracked version download - Removeddownload Visustin v6.12 Pro Edition cracked version - RemovedTgi3D SU Amorph PRO edition Cracked Version - RemovedTgi3D SU Amorph PRO edition Cracked version - RemovedMocap Device Plug-in for iClone5 PRO Edition cracked version download - RemovedVisustin v6.12 Pro Edition cracked version download - RemovedMacDrive Pro v9.0.3.35 Professional Edition cracked version download - Removed
"tangible T4 Editor v2.2.3 Pro Edition cracked version downlo" 没有评论.
Leave a Comment
如果没有下载链接或者下载链接无效,请查看相关链接或者搜索相关资料。
Your name:
Your email (hidden) :
Your comment (Sorry, html code is not allowed) :
Word Verification (Input the characters in the image): 下载
 收藏
愿得一心人,白首不相离
 下载此文档
正在努力加载中...
the tangible video editor
下载积分:30000
内容提示:the tangible video editor
文档格式:PDF|
浏览次数:1|
上传日期: 02:52:01|
文档星级:
该用户还上传了这些文档
下载文档:the tangible video editor.PDF
官方公共微信tangible modelling tools with T4Editor 破解版 - 下载频道 - CSDN.NET
&&&&tangible modelling tools with T4Editor 破解版
&tangible modelling tools with T4Editor 破解版
tangible modelling tools with T4Editor 破解版
用T4Editor_crack.dll替换原来的文件就可以破解了。
若举报审核通过,可奖励20下载分
被举报人:
举报的资源分:
请选择类型
资源无法下载
资源无法使用
标题与实际内容不符
含有危害国家安全内容
含有反动色情等内容
含广告内容
版权问题,侵犯个人或公司的版权
*详细原因:
您可能还需要
Q.为什么我点的下载下不了,但积分却被扣了
A. 由于下载人数众多,下载服务器做了并发的限制。若发现下载不了,请稍后再试,多次下载是不会重复扣分的。
Q.我的积分不多了,如何获取积分?
A. 传优质资源可以获取积分,详细见。选择完成有奖的任务,可以获取积分。选择购买VIP会员服务,无需积分下载资源。评价资源返积分:第一次绑定手机,将获50下载积分及100论坛可用分。论坛可用分兑换下载积分。
下载资源意味着您已经同意遵守以下协议
资源的所有权益归上传用户所有
未经权益所有人同意,不得将资源中的内容挪作商业或盈利用途
CSDN下载频道仅提供交流平台,并不能对任何下载资源负责
下载资源中如有侵权或不适当内容,
本站不保证本站提供的资源的准确性,安全性和完整性,同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
开发技术下载排行
你下载资源过于频繁,请输入验证码
如何快速获得积分?
你已经下载过该资源,再次下载不需要扣除积分
tangible modelling tools with T4Editor 破解版
所需积分:10
剩余积分:
VIP会员,免积分下载
会员到期时间:日
剩余下载次数:1000

我要回帖

更多关于 foxit editor破解版 的文章

 

随机推荐