こんにちは!以前の時代にはXMLを使ってT4を使ってVisual Studio Projectを生成するには?
それはコード・ドムを使用して可能である、私はT4を使用すると、コード・ドムよりもはるかに簡単であることを知るようになりました。私は多くの記事 を通過しましたが、依然として私の要件を満たすコードをドラフトアウトする状況にはありません。
私は自動生成されたXML文書に基づいてコードを生成する必要があります[私の要件としてXML文書を生成することができます]。
それはこのように思える:クラスの
<?xml version="1.0" encoding="utf-8" ?>
<GeneratedSolution Name ="name of Solution">
<GeneratedProject ID="RepoProject" Name ="name of Project" MajorVersion="1" MinorVersion="0" CopyRight="GeneratedProject company" Language="C#" OutExtension="cs">
<Compiler path = "../path/compilername" Build="silent" ExternalBuildTool="NAnt" />
<GeneratedRepository Name ="name of Repository Class" Description="This is generated Repository class would be used for overall-application" TemplateRefence ="../path/repository.tt">
<Operation Name = "Operation1" Description = "This is operation1 of Repository class">
<operationID>1</operationID>
</Operation>
<Operation Name = "Operation2" Description = "This is operation2 of Repository class">
<operationID>2</operationID>
</Operation>
</GeneratedRepository>
</GeneratedProject>
<GeneratedProject ID="BusinessProject" Name ="name of Project" MajorVersion="1" MinorVersion="0" CopyRight="GeneratedProject company">
<GeneratedBusiness Name ="name of Business Class" Description="This is generated Business class would be used for overall-application" TemplateRefence ="../path/business.tt">
<Operation Name = "Operation1" Description = "This is operation1 of Business class">
<operationID>1</operationID>
</Operation>
<Operation Name = "Operation2" Description = "This is operation2 of Business class">
<operationID>2</operationID>
</Operation>
</GeneratedBusiness>
</GeneratedProject>
<GeneratedProject ID="UIProject" Name ="name of Project" MajorVersion="1" MinorVersion="0" CopyRight="GeneratedProject company">
<GeneratedUI Name ="name of UI Class" Description="This is generated UI class would be used for overall-application" TemplateRefence ="../path/UI.tt">
<Operation Name = "Operation1" Description = "This is operation1 of UI class">
<operationID>1</operationID>
</Operation>
<Operation Name = "Operation2" Description = "This is operation2 of UI class">
<operationID>2</operationID>
</Operation>
</GeneratedUI>
</GeneratedProject>
</GeneratedSolution>
号、プロジェクトが単一のソリューション内で変えることができます。 XMLからプロジェクトを作成するアイデアを提供するいくつかの記事を読んでいますが、私は上記の「XML」サンプルのようにコードを生成するために何か必要があります。
この点に関するお手伝いをさせていただきます。
ありがとう!私はブログであなたに従っています。 –
あなたのケースの正確なデモを追加しました:https://github.com/abstractiondev/DemoSOCase8552428ABS – Kallex
本当に感謝します、ありがとうございます。それをフォークするかクローンする必要がありますか?あなたにMERRY X'MASSをお願いします:) –