internal NemerleFileNodeCodeDomProvider(NemerleDependentFileNode fileNode)
 {
     _fileNode = fileNode;
     Init();
 }
示例#2
0
        /// <summary>
        /// Create dependent file node based on an msbuild item
        /// </summary>
        /// <param name="item">msbuild item</param>
        /// <returns>dependent file node</returns>
        public override FileNode CreateDependentFileNode(ProjectElement item)
        {
            ErrorHelper.ThrowIsNull(item, "item");

            NemerleDependentFileNode newNode = new NemerleDependentFileNode(this, item);
            string include = item.GetMetadata(ProjectFileConstants.Include);

            var provider = newNode.OleServiceProvider;

            provider.AddService(typeof(EnvDTE.Project), ProjectMgr.GetAutomationObject(), false);
            provider.AddService(typeof(EnvDTE.ProjectItem), newNode.GetAutomationObject(), false);
            provider.AddService(typeof(VSLangProj.VSProject), this.VSProject, false);

            if (IsCodeFile(include) && item.ItemName == "Compile")
                newNode.OleServiceProvider.AddService(typeof(SVSMDCodeDomProvider),
                    new NemerleVSMDProvider(newNode), false);

            return newNode;
        }