public static FileManager Create(object textTransformation)
    {
        FileManager result  = null;
        bool        inVSNET = false;

        DynamicTextTransformation transformation = DynamicTextTransformation.Create(textTransformation);
        IDynamicHost host = transformation.Host;

        try
        {
#if !PREPROCESSED_TEMPLATE
            if (host.AsIServiceProvider() != null)
            {
                inVSNET = true;
            }
#endif

            result = inVSNET ? new VSManager(transformation) : new FileManager(transformation);
        }
        catch (Exception e)
        {
            //host.LogError(e);
        }
        return(result);
    }
Example #2
0
        public CodeGenerationToolsForK2(object textTransformation)
        {
            if (textTransformation == null)
            {
                throw new ArgumentNullException("textTransformation");
            }

            _textTransformation = DynamicTextTransformation.Create(textTransformation);
            _code = new CSharpCodeProvider();
            _ef   = new MetadataTools(_textTransformation);
        }
Example #3
0
    /// <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();
        FullyQualifySystemTypes = false;
        CamelCaseFields         = true;
        ActiveDTOStage          = false;
    }