public static Create ( object instance ) : |
||
instance | object | |
return |
/// <summary> /// Initializes an MetadataTools Instance with the /// TextTransformation (T4 generated class) that is currently running /// </summary> public MetadataTools(object textTransformation) { if (textTransformation == null) { throw new ArgumentNullException("textTransformation"); } _textTransformation = DynamicTextTransformation.Create(textTransformation); }
/// <summary> /// Initializes an CodeRegion instance with the /// TextTransformation (T4 generated class) that is currently running /// </summary> public CodeRegion(object textTransformation) { if (textTransformation == null) { throw new ArgumentNullException("textTransformation"); } _textTransformation = DynamicTextTransformation.Create(textTransformation); }
/// <summary> /// Initializes an EntityFrameworkTemplateFileManager Instance with the /// TextTransformation (T4 generated class) that is currently running /// </summary> private EntityFrameworkTemplateFileManager(object textTransformation) { if (textTransformation == null) { throw new ArgumentNullException("textTransformation"); } _textTransformation = DynamicTextTransformation.Create(textTransformation); _generationEnvironment = _textTransformation.GenerationEnvironment; }
/// <summary> /// Initializes an MetadataLoader Instance with the /// TextTransformation (T4 generated class) that is currently running /// </summary> public MetadataLoader(object textTransformation) { DefineMetadata(); if (textTransformation == null) { throw new ArgumentNullException("textTransformation"); } _textTransformation = DynamicTextTransformation.Create(textTransformation); }
/// <summary> /// Initializes a new CodeGenerationTools object with the TextTransformation (T4 generated class) /// that is currently running /// </summary> public CodeGenerationTools(object textTransformation) { if (textTransformation == null) { throw new ArgumentNullException("textTransformation"); } _textTransformation = DynamicTextTransformation.Create(textTransformation); _code = new CSharpCodeProvider(); _ef = new MetadataTools(_textTransformation); FullyQualifySystemTypes = false; CamelCaseFields = true; }
/// <summary> /// Creates the VsEntityFrameworkTemplateFileManager if VS is detected, otherwise /// creates the file system version. /// </summary> public static EntityFrameworkTemplateFileManager Create(object textTransformation) { DynamicTextTransformation transformation = DynamicTextTransformation.Create(textTransformation); IDynamicHost host = transformation.Host; #if !PREPROCESSED_TEMPLATE var hostServiceProvider = host.AsIServiceProvider(); if (hostServiceProvider != null) { EnvDTE.DTE dte = (EnvDTE.DTE)hostServiceProvider.GetService(typeof(EnvDTE.DTE)); if (dte != null) { return(new VsEntityFrameworkTemplateFileManager(transformation)); } } #endif return(new EntityFrameworkTemplateFileManager(transformation)); }