/// <summary>
        /// This function is the callback used to execute a command when the a menu item is clicked.
        /// See the Initialize method to see how the menu item is associated to this function using
        /// the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            // Show a Message Box to prove we were here
            IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
            //Guid clsid = Guid.Empty;
            //int result;
            //Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure( uiShell.ShowMessageBox(
            //                                                                           0,
            //                                                                           ref clsid,
            //                                                                           "UT",
            //                                                                           string.Format( CultureInfo.CurrentCulture,
            //                                                                                          "Inside {0}.MenuItemCallback()",
            //                                                                                          this.ToString() ),
            //                                                                           string.Empty,
            //                                                                           0,
            //                                                                           OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //                                                                           OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
            //                                                                           OLEMSGICON.OLEMSGICON_INFO,
            //                                                                           0,
            //                                                                           // false

            //                                                                           out result ) );

            IntPtr hwnd;

            uiShell.GetDialogOwnerHwnd(out hwnd);

            // Get an instance of the currently running Visual Studio IDE
            //DTE dte = (DTE) GetService( typeof( DTE ) );
            //if( !dte.Solution.IsOpen )
            //{
            //    return;
            //}

            //var assemblies = new List<string>();
            //foreach( Project project in dte.Solution.Projects )
            //{
            //    var name = project.Name;

            //    if( name.EndsWith( "Test.Unit" ) )
            //    {
            //        assemblies.Add( GetAssemblyPath( project ) );
            //    }
            //}

            const string solution     = "TouchUI";
            var          assemblyList = new List <string>
            {
                @"D:\TFS\IRIDIUM1\bin\Debug\CT.Exam.TouchUI.FE.Test.Unit.dll",
            };
            //var root = AssemblyWalker.BuildTree( dte.Solution.FileName, assemblies );
            var root = AssemblyWalker.BuildTree(solution, assemblyList);

            MainWindow mainWindow = new MainWindow();

            var projects = new UtTreeViewModel(root);

            mainWindow.DataContext = projects;
            WindowHelper.ShowModal(mainWindow, hwnd);
        }
Exemple #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var solution     = "TouchUI";
            var assemblyList = new List <string>
            {
                //@"D:\TFS\SSME.HMI\bin\Debug\CT.Exam.TouchUI.FE.Test.Unit.dll",
                @"C:\Users\sxu\source\repos\CalculatorDemo\CalculatorDemoTests\bin\Debug\CalculatorDemoTests.dll",
            };
            var treeRoot = AssemblyWalker.BuildTree(solution, assemblyList);

            var projects = new UtTreeViewModel(treeRoot);

            UTAssistant.FE.MainWindow mainWindow = new UTAssistant.FE.MainWindow();
            mainWindow.DataContext = projects;

            mainWindow.ShowDialog();
        }
Exemple #3
0
 public SearchTreeCommand(UtTreeViewModel tree)
 {
     myTree = tree;
 }