Example #1
0
 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;
        }