我在哪里可以找到MvcTextTemplateHost的API规范?

Ser*_*rgi 7 t4 asp.net-mvc-3

我正在尝试使用自定义T4模板将新控制器添加到MVC 3项目中.我有自己的模板,Scott Hanselman在http://www.hanselman.com/blog/ModifyingTheDefaultCodeGenerationscaffoldingTemplatesInASPNETMVC.aspx上写道,但我有兴趣在MvcTextTemplateHost类中挖掘更多,看看它提供了什么,所以我们可以自定义我们的控制器,看看它如何与"添加控制器..."对话框进行交互.

但是我找不到(在搜索谷歌之后,当然......)对这个类的引用,也没有MSDN或者任何其他MS站点...任何想法?

谢谢,塞尔吉

Sco*_*man 9

你会发现这只是一个可扩展的点.而是花时间使用Steven Sanderson的新MvcScaffolding包.他把这个原始的东西扩展到了我的计划之外.


sab*_*our 5

public bool AddActionMethods { get; set; }
internal ProjectItem AreaFolder { get; set; }
public string AreaName { get; set; }
public List<string> AssemblyPath { get; set; }
public bool AutoEventWireup { get; set; }
public List<string> ContentPlaceHolderIDs { get; set; }
public Type ContextType { get; set; }
public string ControllerName { get; set; }
public string ControllerRootName { get; set; }
public string EntitySetName { get; set; }
public CompilerErrorCollection Errors { get; set; }
[Dynamic]
public object ExtendedProperties { [return: Dynamic] get; }
public Encoding FileEncoding { get; set; }
public string FileExtension { get; set; }
public Version FrameworkVersion { get; set; }
internal AppDomain GenerationAppDomain { get; set; }
public bool IsContentPage { get; set; }
public bool IsPartialView { get; set; }
public string MasterPageFile { get; set; }
IList<string> ITextTemplatingEngineHost.StandardAssemblyReferences { get; }
IList<string> ITextTemplatingEngineHost.StandardImports { get; }
public Type ModelType { get; set; }
public string Namespace { get; set; }
public string OutputFileExtension { get; set; }
public IPluralizer Pluralizer { get; set; }
public string PrimaryContentPlaceHolderID { get; set; }
public PrimaryKey[] PrimaryKeys { get; set; }
public bool ReferenceScriptLibraries { get; set; }
public Dictionary<string, RelatedModel> RelatedProperties { get; set; }
public string TemplateFile { get; set; }
public Type ViewDataType { get; set; }
public string ViewDataTypeName { get; set; }
public string ViewName { get; set; }
Run Code Online (Sandbox Code Playgroud)


Roy*_*tus 1

反光板将是您的最佳选择。它允许您反编译 DLL。您可以直接在http://shop.reflector.net/download下载。