Esempio n. 1
0
        public void how_to_convert_IVsProject_to_DTE_project()
        {
            // Say you got an IVsProject somehow.
            IVsProject vsProject = this.IVsLibrary;

            EnvDTE.Project dteProject = vsProject.Adapt().AsDteProject();

            Assert.IsNotNull(dteProject);

            // Use the DTE project API, such as to save the project:
            dteProject.Save();
        }
Esempio n. 2
0
        public void how_to_convert_IVsProject_to_MsBuildProject()
        {
            // Say you got an IVsProject somehow.
            IVsProject vsProject = this.IVsLibrary;

            Microsoft.Build.Evaluation.Project msbuildProject = vsProject.Adapt().AsMsBuildProject();

            Assert.IsNotNull(msbuildProject);

            // Access the MSBuild imports, for example
            Assert.IsTrue(msbuildProject.Imports.Count > 0);
        }
Esempio n. 3
0
        public void how_to_convert_IVsProject_to_VSProject()
        {
            // Say you got an IVsProject somehow.
            IVsProject vsProject = this.IVsLibrary;

            VSLangProj.VSProject langProject = vsProject.Adapt().AsVsLangProject();

            Assert.IsNotNull(langProject);

            // Use the project, for example, to create the Web References folder
            EnvDTE.ProjectItem folder = langProject.CreateWebReferencesFolder();
            Assert.IsNotNull(folder);
        }
Esempio n. 4
0
        public void how_to_convert_IVsProject_project_to_IProjectNode()
        {
            // Say you got an IVsProject somehow.
            IVsProject vsProject = this.IVsLibrary;

            IProjectNode projectNode = vsProject.Adapt().AsProjectNode();

            Assert.IsNotNull(projectNode);

            // Now we can use Clide's project node API, such as accessing
            // retrieving the active platform

            Assert.AreEqual("AnyCPU", projectNode.Configuration.ActivePlatform);
        }