public override void Initialize() { base.Initialize(); generalPropertyPage = new GeneralPropertyPage(); customProjectPackage = new CustomProjectPackage(); ((IVsPackage)customProjectPackage).SetSite(serviceProvider); customProjectFactory = new MyCustomProjectFactory(customProjectPackage); base.SetMsbuildEngine(customProjectFactory); int canCreate; if(VSConstants.S_OK == ((IVsProjectFactory)customProjectFactory).CanCreateProject(projectFile, 2, out canCreate)) { PrivateType type = new PrivateType(typeof(MyCustomProjectFactory)); PrivateObject obj = new PrivateObject(customProjectFactory, type); projectNode = (MyCustomProjectNode)obj.Invoke("PreCreateForOuter", new object[] { IntPtr.Zero }); Guid iidProject = new Guid(); int pfCanceled; projectNode.Load(projectFile, "", "", 2, ref iidProject, out pfCanceled); } }
/// <summary> /// Initializes a new instance of the <see cref="MyCustomProjectNode"/> class. /// </summary> /// <param name="package">Value of the project package for initialize internal package field.</param> public MyCustomProjectNode(CustomProjectPackage package) { this.package = package; InitializeImageList(); this.CanProjectDeleteItems = true; }
/// <summary> /// Initializes a new instance of the <see cref="MyCustomProjectNode"/> class. /// </summary> /// <param name="package">Value of the project package for initialize internal package field.</param> public MyCustomProjectNode(CustomProjectPackage package) { this.package = package; InitializeImageList(); this.CanProjectDeleteItems = true; }
public void InitializeTest() { IVsPackage package = new CustomProjectPackage(); int expected = VSConstants.S_OK; int actual = package.SetSite(serviceProvider); Assert.AreEqual(expected, actual, "SetSite did not return VSConstants.S_OK"); actual = package.SetSite(null); Assert.AreEqual(expected, actual, "SetSite(null) did not return VSConstants.S_OK"); }
public void IsIVsPackage() { CustomProjectPackage package = new CustomProjectPackage(); Assert.IsNotNull(package as IVsPackage, "The object does not implement IVsPackage"); }
public void ConstructorTest() { CustomProjectPackage package = new CustomProjectPackage(); Assert.IsNotNull(package, "Constructor failed"); }
/// <summary> /// Initializes a new instance of the <see cref="MyCustomProjectNode"/> class. /// </summary> /// <param name="package">Value of the project package for initialize internal package field.</param> public MyCustomProjectNode(CustomProjectPackage package) { this.package = package; InitializeImageList(); }
/// <summary> /// Initializes a new instance of the <see cref="MyCustomProjectNode"/> class. /// </summary> /// <param name="package">Value of the project package for initialize internal package field.</param> public MyCustomProjectNode(CustomProjectPackage package) { this.package = package; InitializeImageList(); }
/// <summary> /// Explicit default constructor. /// </summary> /// <param name="package">Value of the project package for initialize internal package field.</param> public MyCustomProjectFactory(CustomProjectPackage package) : base(package) { this.package = package; }
public override void Initialize() { base.Initialize(); customProjectPackage = new CustomProjectPackage(); ((IVsPackage)customProjectPackage).SetSite(serviceProvider); }
/// <summary> /// Explicit default constructor. /// </summary> /// <param name="package">Value of the project package for initialize internal package field.</param> public MyCustomProjectFactory(CustomProjectPackage package) : base(package) { this.package = package; }