public void MyTestCleanup() { try { if (TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Failure)) { FileInfo[] files = new DirectoryInfo(Path.GetTempPath()).GetFiles("w_*.log"); //this section is what's really important for your application. foreach (FileInfo file in files) { file.CopyTo(@"c:\temp\testfail\" + file.Name, true); } } // Check that no dialogs need to be closed _powerSHAPE.Execute("CANCEL"); // Switch FormUpdate and Dialogs back on _powerSHAPE.FormUpdateOn(); _powerSHAPE.DialogsOn(); // Close model _powerSHAPE.Models.Clear(); } catch (Exception) { } }
public void MyTestCleanup() { try { // Switch FormUpdate and Dialogs back on _powerSHAPE.FormUpdateOn(); _powerSHAPE.DialogsOn(); // Close model _powerSHAPE.Models.Clear(); } catch (Exception) { } }
public void MyTestCleanup() { try { // Check that no dialogs need to be closed _powerSHAPE.Execute("CANCEL"); // Switch FormUpdate and Dialogs back on _powerSHAPE.FormUpdateOn(); _powerSHAPE.DialogsOn(); // Close all models _powerSHAPE.Models.Clear(); } catch (Exception) { } }
static void ClosingSafely() { powerSHAPE.FormUpdateOn(); powerSHAPE.RefreshOn(); powerSHAPE.DialogsOn(); }