Наследование: Microsoft.VisualStudio.Project.ProjectNode
        public override void Initialize()
        {
            base.Initialize();

            generalPropertyPage = new XSharpGeneralPropertyPage();

            customProjectPackage = new XSharpProjectPackage();
            ((IVsPackage)customProjectPackage).SetSite(serviceProvider);

            customProjectFactory = new XSharpProjectFactory(customProjectPackage);

            base.SetMsbuildEngine(customProjectFactory);

            int canCreate;
            if(VSConstants.S_OK == ((IVsProjectFactory)customProjectFactory).CanCreateProject(projectFile, 2, out canCreate))
            {
                PrivateType type = new PrivateType(typeof(XSharpProjectFactory));
                PrivateObject obj = new PrivateObject(customProjectFactory, type);
                projectNode = (XSharpProjectNode)obj.Invoke("PreCreateForOuter", new object[] { IntPtr.Zero });

                Guid iidProject = new Guid();
                int pfCanceled;
                projectNode.Load(projectFile, "", "", 2, ref iidProject, out pfCanceled);
            }
        }
 public void ConstructorTest()
 {
     XSharpProjectNode customProject = new XSharpProjectNode(customProjectPackage);
     Assert.IsNotNull(customProject, "Constructor failed");
 }
 /// <summary>
 /// Public constructor.
 /// </summary>
 /// <param name="project">Custom project.</param>
 public OAXSharpProject(XSharpProjectNode project)
     : base(project)
 {
 }
Пример #4
0
 /// <summary>
 /// Creates a new project by cloning an existing template project.
 /// </summary>
 /// <returns></returns>
 protected override ProjectNode CreateProject()
 {
     XSharpProjectNode project = new XSharpProjectNode(this.package);
     project.SetSite((IOleServiceProvider)((IServiceProvider)this.package).GetService(typeof(IOleServiceProvider)));
     return project;
 }