示例#1
0
        /// <summary>
        /// Inits the specified model.
        /// </summary>
        private void Init(DomainModel model, ModelElement rootElement, ModelElement currentElement,
                          ICodeGenerationService codeGenerationService, Type extenderType)
        {
            this.codeGenerationService = codeGenerationService;
            this.model             = model;
            this.rootElement       = rootElement;
            this.currentElement    = currentElement;
            this.baseDirectory     = AppDomain.CurrentDomain.BaseDirectory;
            this.projectReferences = new List <Guid>();

            AddStandardImports();
            AddStandardAssemblyReferences();
            standardAssemblyReferences.AddFromAssembly(Assembly.GetExecutingAssembly());

            InitializeFromModel(model);
            InitializeFromElement(rootElement);

            InitializeModelElementExtender(currentElement, extenderType);

            TextTemplateHost.instance = this;
            this.generateOutput       = true;
        }
示例#2
0
 public override void Initialize(ITextTemplatingEngineHost host)
 {
     templateEngineHost = host as TextTemplateHost;
     base.Initialize(host);
 }