コード例 #1
0
    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);
    }
コード例 #2
0
        public CodeGenerationToolsForK2(object textTransformation)
        {
            if (textTransformation == null)
            {
                throw new ArgumentNullException("textTransformation");
            }

            _textTransformation = DynamicTextTransformation.Create(textTransformation);
            _code = new CSharpCodeProvider();
            _ef   = new MetadataTools(_textTransformation);
        }
コード例 #3
0
ファイル: Template.Utility.CS.cs プロジェクト: psulek/doemd
    /// <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;
    }