private void Button_Click(object sender, RoutedEventArgs e) { SelectHelper.StartSimulation = true; if (btnSimulation.Content.ToString() == "Start Simulation") { if (WindowsRadioButton.IsChecked.Value) { if ((SelectHelper.CurrentPlugin != null) && (!(SelectHelper.CurrentPlugin is Windows.WindowsPlugin))) { ICustomPluginInterface icustplugin = (ICustomPluginInterface)SelectHelper.CurrentPlugin; icustplugin.StopScraping(ApplicationId); } SelectHelper.CurrentScrapMode = ScrapMode.Windows; TabWindowsProperties.IsSelected = true; VisualUIAVerify.Controls.AutomationElementTreeControl vc = (VisualUIAVerify.Controls.AutomationElementTreeControl)SelectHelper._automationElementTree; VisualUIAVerify.Controls.TreeHelper.flag = false; vc.Refresh(); WindowsPlugin.Instance.StartScraping(ApplicationId); TabFields.IsSelected = true; } else { WindowsPlugin.Instance.StopScraping(ApplicationId); if (SelectHelper.CurrentPlugin != null) { ICustomPluginInterface icustplugin = (ICustomPluginInterface)SelectHelper.CurrentPlugin; icustplugin.StartScraping(ApplicationId); } } btnSimulation.Content = "Stop Simulation"; //iSimulatApp.StartSimultion(currentISimulationAppKey); } else { SelectHelper.StartSimulation = false; btnSimulation.Content = "Start Simulation"; //iSimulatApp.StopSimultion(currentISimulationAppKey); WindowsPlugin.Instance.StopScraping(ApplicationId); if (SelectHelper.CurrentPlugin != null) { ICustomPluginInterface icustplugin = (ICustomPluginInterface)SelectHelper.CurrentPlugin; icustplugin.StopScraping(ApplicationId); } } }
public ScrapingWindow() { InitializeComponent(); if (iOpenFile > 0) { for (int i = 0; i < iOpenFile; i++) { SelectHelper.Scraping -= Scraping; } } iOpenFile = 0; SelectHelper.Scraping += Scraping; iOpenFile = iOpenFile + 1; iSaveFieldOperations = 0; if (iSaveFieldOperations > 0) { for (int i = 0; i < iSaveFieldOperations; i++) { SelectHelper.SaveFieldOperations -= SaveFieldOperations; } } iSaveFieldOperations = 0; SelectHelper.SaveFieldOperations += SaveFieldOperations; iSaveFieldOperations = iSaveFieldOperations + 1; this.options = new TestOptions(); this.options.BooleanProperty = true; //if (SelectHelper._automationElementTree == null) //{ _automationElementTree = new VisualUIAVerify.Controls.AutomationElementTreeControl(); //} //else //{ // _automationElementTree = (VisualUIAVerify.Controls.AutomationElementTreeControl)SelectHelper._automationElementTree; // _automationElementTree.Refresh(); //} _automationElementTree.RootElement = AutomationElement.RootElement; SelectHelper._automationElementTree = _automationElementTree; }
private void WindowsRadioButton_Click(object sender, RoutedEventArgs e) { if (WindowsRadioButton.IsChecked.Value) { if (SelectHelper.CurrentScrapMode != ScrapMode.Windows) { SelectHelper.CurrentScrapMode = ScrapMode.Windows; } if (SelectHelper.CurrentPlugin != null) { ICustomPluginInterface icustplugin = (ICustomPluginInterface)SelectHelper.CurrentPlugin; icustplugin.StopScraping(ApplicationId); } if (SelectHelper.StartSimulation == true) { TabWindowsProperties.IsSelected = true; VisualUIAVerify.Controls.AutomationElementTreeControl vc = (VisualUIAVerify.Controls.AutomationElementTreeControl)SelectHelper._automationElementTree; vc.Refresh(); WindowsPlugin.Instance.StartScraping(ApplicationId); TabFields.IsSelected = true; } else { WindowsPlugin.Instance.StopScraping(ApplicationId); } } else { WindowsPlugin.Instance.StopScraping(ApplicationId); if (SelectHelper.CurrentPlugin != null) { ICustomPluginInterface icustplugin = (ICustomPluginInterface)SelectHelper.CurrentPlugin; icustplugin.StartScraping(ApplicationId); } } }