Visual Studio Custom Project System

155 views Asked by At

I am working on a custom project system(Directory based project) for Visual Studio using VSPackage. I have followed msdn links Basic Project System part 1 and Basic Project System part 2 to create my project system. So far it is working good.

The idea of the project system is to allow visual studio to act as an editor to take advantage of its powerful Intellisense (for c# ,C++ and other languages supported by VS) and use a custom build to build the project.

Problem:
Now I am trying to add Folders and files under that folder (not from the templates) as part of the Project initialization by overriding the following method InitializeForOuter in SimpleProjectNode.cs. And I am stuck here. I am not sure what is the right way to add folders/files.

Could someone help me in this? Thanks

public override int InitializeForOuter(string filename, string location, string name, uint flags, ref Guid iid,
        out IntPtr projectPointer, out int canceled)
    {
        var result =  base.InitializeForOuter(filename, location, name, flags, ref iid, out projectPointer, out canceled);

        var folderNode = @"test\level1\level2";
        this.CreateFolderNodes(folderNode);

        var fileNode2 = this.CreateFileNode(folderNode+"\\file1.cs");
        AddChild(fileNode2);

        return result;
    }
0

There are 0 answers