public void FileSave(string output_file, bool save_alpha, string color_space, FormatDescription fmt, string inputfile) { Tracing.StartMethodTrace(); this.VerifyAlive(); this.VerifyNoDialogs(); this.VerifyDocumentCount(1); WindowsAutomation.IO.VerifyFileDoesNotExist(output_file); WindowsAutomation.UI.Menu_Select(this.XaraAppHWND, "file", "export..."); // We know the command succeeded if the SaveAs dialog is up int the_dialog = this.WaitForDialogToAppear("Export file", 5 * 1000); this.Sleep(500); System.Collections.Generic.List <int> comboboxes = UI.Window_FindChildWindowsEx(the_dialog, 0, "ComboBox", null, null, 0); int the_combobox = (int)comboboxes[2]; string ext = fmt.FilenameExtension; ext = ".tif"; WindowsAutomation.UI.ComboBox_SelectItem(the_combobox, ext); this.Sleep(500); int eb = UI.Window_GetChild(the_dialog, WindowClassEnum.EditFieldWindowClass, null); UI.SetTextRaw(eb, output_file); this.Sleep(500); int SAVE_button = UI.Window_GetChild(the_dialog, WindowClassEnum.ButtonWindowClass, "Export"); UI.Mouse_LeftClick(SAVE_button); this.WaitForDialogToDisappear(the_dialog); // This section handles the Layer warning dialog and the tif export options dialog // The layer warning dialog only appears (when layers need to be collapsed) // The export options dialog appears every time this.Sleep(500); //this.HandleLayerWarningDialog( ); //this.Sleep(500); this.HandleExportOptions(color_space); this.Sleep(500); this.WaitForFileAccess(output_file); this.VerifyAlive(); this.VerifyNoDialogs(); this.VerifyDocumentCount(1); Tracing.EndMethodTrace(); }
public void FileSave( string output_file, bool save_alpha, string color_space, FormatDescription fmt, string inputfile) { Tracing.StartMethodTrace(); this.VerifyAlive(); this.VerifyNoDialogs(); this.VerifyDocumentCount(1); WindowsAutomation.IO.VerifyFileDoesNotExist( output_file ); WindowsAutomation.UI.Menu_Select( this.XaraAppHWND, "file", "export..." ); // We know the command succeeded if the SaveAs dialog is up int the_dialog = this.WaitForDialogToAppear( "Export file" , 5*1000); this.Sleep(500); System.Collections.Generic.List<int> comboboxes = UI.Window_FindChildWindowsEx(the_dialog, 0, "ComboBox", null, null, 0); int the_combobox = (int) comboboxes[2]; string ext = fmt.FilenameExtension; ext = ".tif"; WindowsAutomation.UI.ComboBox_SelectItem( the_combobox, ext ); this.Sleep( 500 ); int eb = UI.Window_GetChild( the_dialog, WindowClassEnum.EditFieldWindowClass , null ) ; UI.SetTextRaw( eb, output_file ); this.Sleep( 500 ); int SAVE_button= UI.Window_GetChild( the_dialog , WindowClassEnum.ButtonWindowClass, "Export" ); UI.Mouse_LeftClick( SAVE_button ); this.WaitForDialogToDisappear( the_dialog ); // This section handles the Layer warning dialog and the tif export options dialog // The layer warning dialog only appears (when layers need to be collapsed) // The export options dialog appears every time this.Sleep(500); //this.HandleLayerWarningDialog( ); //this.Sleep(500); this.HandleExportOptions( color_space ); this.Sleep(500); this.WaitForFileAccess( output_file ); this.VerifyAlive(); this.VerifyNoDialogs(); this.VerifyDocumentCount(1); Tracing.EndMethodTrace(); }