private void TestProjectConfigurationMenuItem_Click(object sender, RoutedEventArgs e) { TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip; this.testProjectsViewModel.TestProjectConfigurationCommand.Execute(testProjectShip.Name); testProjectShip.RaisePropertyChanged(); }
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); }
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); } }
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); } } }
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(); } }
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(); } } } }
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); }
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(); } }
private void CloseTestProject_Click(object sender, RoutedEventArgs e) { TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip; this.CloseTestProjectEvent?.Invoke(testProjectShip, null); }
private void OpenTestProjectFolderMenuItem_Click(object sender, RoutedEventArgs e) { TestProjectShip testProjectShip = this.TestProjectTreeView.SelectedItem as TestProjectShip; Process.Start("Explorer.exe", Path.GetFullPath(testProjectShip.TestProjectInfo.Location)); }