public virtual IVsTask CreateProjectAsync(ref Guid rguidProjectID, string filename, string location, string pszName, uint flags)
{
Guid iid = typeof(IVsHierarchy).GUID;
return VsTaskLibraryHelper.CreateAndStartTask(taskSchedulerService.Value, VsTaskRunContext.UIThreadBackgroundPriority, VsTaskLibraryHelper.CreateTaskBody(() =>
{
IntPtr project;
int cancelled;
CreateProject(filename, location, pszName, flags, ref iid, out project, out cancelled);
if (cancelled != 0)
{
throw new OperationCanceledException();
}
return Marshal.GetObjectForIUnknown(project);
}));
}