When implemented in a derived class creates a new project.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Protected MustOverride Function CreateProject As ProjectNode
'使用
Dim returnValue As ProjectNode
returnValue = Me.CreateProject()
protected abstract ProjectNode CreateProject()
protected:
virtual ProjectNode^ CreateProject() abstract
protected abstract function CreateProject() : ProjectNode
Return Value
Type: Microsoft.VisualStudio.Package.ProjectNode
Remarks
Implementers should create and return a new ProjectNode, for example by cloning an existing template project (which could be empty).
Examples
The following example is from Walkthrough: Creating a Project Using the MPF Classes.
[C#]
#region Using directives
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using Microsoft.Win32;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Shell;
using MSVSIP = Microsoft.VisualStudio.Shell;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
#endregion
protected override Microsoft.VisualStudio.Package.Project CreateProject()
{
CMPFProject pProject = new CMPFProject((MPFtestProject)this.package);
pProject.SetSite((IOleServiceProvider)((IServiceProvider)this.package).GetService(typeof(IOleServiceProvider)));
return pProject;
}
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.