public void Deactivate() { if (null != this.control) { this.control.Dispose(); this.control = null; } }
public void Activate(IntPtr parent, RECT[] pRect, int bModal) { if (this.control == null) { this.control = new CompileOrderViewer(((IProjectManager)item)); this.control.Size = new Size(pRect[0].right - pRect[0].left, pRect[0].bottom - pRect[0].top); this.control.Visible = false; this.control.Size = new Size(550, 300); this.control.CreateControl(); NativeMethods.SetParent(this.control.Handle, parent); this.control.OnPageUpdated += (sender, args) => IsDirty = true; } }
private void Initialize() { Assert.IsTrue(File.Exists(ctx.Properties["cleanproj"].ToString()), "Clean project file could not be found"); File.Delete(ctx.Properties["suo"].ToString()); File.Copy(ctx.Properties["cleanproj"].ToString(), ctx.Properties["testproj"].ToString(), true); sln.OpenSolutionFile((uint)__VSSLNOPENOPTIONS.SLNOPENOPT_Silent, ctx.Properties["slnfile"].ToString()); sln.GetProjectOfUniqueName(ctx.Properties["testproj"].ToString(), out hier); Assert.IsNotNull(hier, "Failed to open the clean test project"); viewer = new CompileOrderViewer((IProjectManager)hier); Assert.IsNotNull(viewer, "Fail to create Viewer"); }
private void Initialize() { File.Delete(ctx.Properties["suo"].ToString()); File.Copy(ctx.Properties["projfile"].ToString(), ctx.Properties["testfile"].ToString(), true); IVsHierarchy hier; IVsSolution sln = VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)) as IVsSolution; sln.OpenSolutionFile((uint)__VSSLNOPENOPTIONS.SLNOPENOPT_Silent, ctx.Properties["slnfile"].ToString()); sln.GetProjectOfUniqueName(ctx.Properties["testfile"].ToString(), out hier); Assert.IsNotNull(hier, "Project is not IProjectManager"); CompileOrderViewer viewer = new CompileOrderViewer((IProjectManager)hier); Assert.IsNotNull(viewer, "Fail to create Viewer"); ctx.Properties["viewer"] = viewer; ctx.Properties["solution"] = sln; ctx.Properties["hierarchy"] = hier; }