/// <summary> /// Ctor to setup the ItemCollectionBuilder members /// </summary> protected ItemCollectionBuilder(DynamicTextTransformation textTransformation, string fileExtension, string edmxSectionName, string rootElementName) { _textTransformation = textTransformation; _fileExtension = fileExtension; _edmxSectionName = edmxSectionName; _rootElementName = rootElementName; }
/// <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 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 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 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 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 an instance of the DynamicTextTransformation class around the passed in /// TextTransformation shapped instance passed in, or if the passed in instance /// already is a DynamicTextTransformation, it casts it and sends it back. /// </summary> public static DynamicTextTransformation Create(object instance) { if (instance == null) { throw new ArgumentNullException("instance"); } DynamicTextTransformation textTransformation = instance as DynamicTextTransformation; if (textTransformation != null) { return(textTransformation); } return(new DynamicTextTransformation(instance)); }
/// <summary> /// Returns true if the specified file path is valid /// </summary> private static bool ValidateInputPath(string sourcePath, DynamicTextTransformation textTransformation) { if (String.IsNullOrEmpty(sourcePath)) { throw new ArgumentException("sourcePath"); } if (sourcePath == "$edmxInputFile$") { textTransformation.Errors.Add(new CompilerError(textTransformation.Host.TemplateFile ?? CodeGenerationTools.GetResourceString("Template_CurrentlyRunningTemplate"), 0, 0, string.Empty, CodeGenerationTools.GetResourceString("Template_ReplaceVsItemTemplateToken"))); return(false); } return(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)); }
/// <summary> /// Returns true if the specified file path is valid /// </summary> private static bool ValidateInputPath(string sourcePath, DynamicTextTransformation textTransformation) { if (String.IsNullOrEmpty(sourcePath)) { throw new ArgumentException("sourcePath"); } if (sourcePath == "$edmxInputFile$") { textTransformation.Errors.Add(new CompilerError(textTransformation.Host.TemplateFile ?? CodeGenerationTools.GetResourceString("Template_CurrentlyRunningTemplate"), 0, 0, string.Empty, CodeGenerationTools.GetResourceString("Template_ReplaceVsItemTemplateToken"))); return false; } return true; }
/// <summary> /// Ctor to setup the ItemCollectionBuilder members /// </summary> protected ItemCollectionBuilder(DynamicTextTransformation textTransformation, string fileExtension, string edmxSectionName, string rootElementName) { _textTransformation = textTransformation; _fileExtension = fileExtension; _edmxSectionName = edmxSectionName; _rootElementName = rootElementName; }
public StorageMappingItemCollectionBuilder(DynamicTextTransformation textTransformation, EdmItemCollection edmItemCollection, StoreItemCollection storeItemCollection) : base(textTransformation, MetadataConstants.MSL_EXTENSION, MetadataConstants.MSL_EDMX_SECTION_NAME, MetadataConstants.MSL_ROOT_ELEMENT_NAME) { _edmItemCollection = edmItemCollection; _storeItemCollection = storeItemCollection; }
public EdmItemCollectionBuilder(DynamicTextTransformation textTransformation, IEnumerable <string> referenceSchemas) : this(textTransformation) { _referenceSchemas.AddRange(referenceSchemas); }
public EdmItemCollectionBuilder(DynamicTextTransformation textTransformation) : base(textTransformation, MetadataConstants.CSDL_EXTENSION, MetadataConstants.CSDL_EDMX_SECTION_NAME, MetadataConstants.CSDL_ROOT_ELEMENT_NAME) { }
public StorageMappingItemCollectionBuilder(DynamicTextTransformation textTransformation, EdmItemCollection edmItemCollection, StoreItemCollection storeItemCollection) : base(textTransformation, MetadataConstants.MSL_EXTENSION, MetadataConstants.MSL_EDMX_SECTION_NAME, MetadataConstants.MSL_ROOT_ELEMENT_NAME) { _edmItemCollection = edmItemCollection; _storeItemCollection = storeItemCollection; }
public StoreItemCollectionBuilder(DynamicTextTransformation textTransformation) : base(textTransformation, MetadataConstants.SSDL_EXTENSION, MetadataConstants.SSDL_EDMX_SECTION_NAME, MetadataConstants.SSDL_ROOT_ELEMENT_NAME) { }
public EdmItemCollectionBuilder(DynamicTextTransformation textTransformation, IEnumerable<string> referenceSchemas) : this(textTransformation) { _referenceSchemas.AddRange(referenceSchemas); }