コード例 #1
0
        private void TestProjectConfigurationMenuItem_Click(object sender, RoutedEventArgs e)
        {
            TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip;

            this.testProjectsViewModel.TestProjectConfigurationCommand.Execute(testProjectShip.Name);
            testProjectShip.RaisePropertyChanged();
        }
コード例 #2
0
        private void DeleteTestProject_Click(object sender, RoutedEventArgs e)
        {
            TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip;

            this.CloseTestProjectEvent?.Invoke(testProjectShip, null);
            this.testProjectsViewModel.DeleteTestProjectCommand.Execute(testProjectShip.TestProjectInfo);
        }
コード例 #3
0
 private void ImportTestMethods_Click(object sender, RoutedEventArgs e)
 {
     if (this.ImportTestMethodsEvent != null)
     {
         TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip;
         this.ImportTestMethodsEvent.Invoke(testProjectShip.TestProjectInfo, e);
     }
 }
コード例 #4
0
 private void TestProjectTreeView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (this.OpenTestProjectEvent != null)
     {
         TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip;
         if (testProjectShip != null)
         {
             this.OpenTestProjectEvent.Invoke(testProjectShip.TestProjectInfo, e);
         }
     }
 }
コード例 #5
0
        private void RemoveTestAssembly_Click(object sender, RoutedEventArgs e)
        {
            TestAssembly assembly = this.TestProjectTreeView.SelectedItem as TestAssembly;

            if (assembly != null)
            {
                DependencyObject parent = VisualTreeHelper.GetParent(current as TreeViewItem);
                while (!(parent is TreeViewItem))
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }

                TestProjectShip testProjectShip = (parent as TreeViewItem).Header as TestProjectShip;
                testProjectShip.TestProjectInfo.TestMethods.RemoveAll(o => assembly.TestCases.Contains(o));
                testProjectShip.RaisePropertyChanged();
            }
        }
コード例 #6
0
ファイル: MainWindow.xaml.cs プロジェクト: cswangrf/DiDiWe
        private void TestProjectView_CloseTestProjectEvent(object sender, System.EventArgs e)
        {
            TestProjectsViewModel testProjectsView = this.testProjectView.DataContext as TestProjectsViewModel;

            if (testProjectsView != null)
            {
                TestProjectShip testProject = sender as TestProjectShip;
                testProjectsView.CloseTestProjectCommand.Execute(testProject.TestProjectInfo);
                LayoutDocumentPane firstDocumentPane = dockManager.Layout.Descendents().OfType <LayoutDocumentPane>().FirstOrDefault();
                LayoutContent      temp = firstDocumentPane.Children.FirstOrDefault(o => o.Title == testProject.Name && o.ToolTip.ToString() == testProject.TestProjectInfo?.Location);
                if (temp != null && temp is LayoutDocument)
                {
                    LayoutDocument doc = temp as LayoutDocument;
                    if (doc.CanClose)
                    {
                        doc.Close();
                    }
                }
            }
        }
コード例 #7
0
        private void TestProjectTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TestCaseInfo caseInfo = this.TestProjectTreeView.SelectedItem as TestCaseInfo;

            if (caseInfo != null)
            {
                DependencyObject parent = VisualTreeHelper.GetParent(current as TreeViewItem);
                while (!(parent is TreeViewItem))
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }

                parent = VisualTreeHelper.GetParent(parent);
                while (!(parent is TreeViewItem))
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }

                TestProjectShip testProjectShip = (parent as TreeViewItem).Header as TestProjectShip;
                this.testProjectsViewModel.SelectedItemChanged(testProjectShip);
            }

            TestAssembly assembly = this.TestProjectTreeView.SelectedItem as TestAssembly;

            if (assembly != null)
            {
                DependencyObject parent = VisualTreeHelper.GetParent(current as TreeViewItem);
                while (!(parent is TreeViewItem))
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }

                TestProjectShip testProjectShip = (parent as TreeViewItem).Header as TestProjectShip;
                this.testProjectsViewModel.SelectedItemChanged(testProjectShip);
            }

            this.testProjectsViewModel.SelectedItemChanged(this.TestProjectTreeView.SelectedItem);
        }
コード例 #8
0
        private void RemoveTestMethod_Click(object sender, RoutedEventArgs e)
        {
            TestCaseInfo caseInfo = this.TestProjectTreeView.SelectedItem as TestCaseInfo;

            if (caseInfo != null)
            {
                DependencyObject parent = VisualTreeHelper.GetParent(current as TreeViewItem);
                while (!(parent is TreeViewItem))
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }

                // TestAssembly
                parent = VisualTreeHelper.GetParent(parent);
                while (!(parent is TreeViewItem))
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }

                TestProjectShip testProjectShip = (parent as TreeViewItem).Header as TestProjectShip;
                testProjectShip.TestProjectInfo.TestMethods.Remove(caseInfo);
                testProjectShip.RaisePropertyChanged();
            }
        }
コード例 #9
0
        private void CloseTestProject_Click(object sender, RoutedEventArgs e)
        {
            TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip;

            this.CloseTestProjectEvent?.Invoke(testProjectShip, null);
        }
コード例 #10
0
        private void OpenTestProjectFolderMenuItem_Click(object sender, RoutedEventArgs e)
        {
            TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip;

            Process.Start("Explorer.exe", Path.GetFullPath(testProjectShip.TestProjectInfo.Location));
        }