private void State_OnDownloadComplete(object sender, EventArgs e) { OSBLEStateEventArgs osea = e as OSBLEStateEventArgs; if (!osea.Success) { // Show/hide interface components MainProgressBar.Visibility = System.Windows.Visibility.Collapsed; OKButton.Visibility = System.Windows.Visibility.Visible; CancelButton.Visibility = System.Windows.Visibility.Visible; // Display an error message MessageBox.Show(osea.Message); } else { // If the stream is null then show the message if (null == osea.Stream) { Core.App.Workspace.DrawingCanvasReference.GetWorkspace().Clear(); MessageBox.Show(osea.Message); } else { Core.App.Workspace.DrawingCanvasReference.GetWorkspace().Load(osea.Stream); } // Dettach listener and set the state reference to null m_state.OnDownloadComplete -= this.State_OnDownloadCompleteCrossThread; m_state = null; this.DialogResult = true; } }
private void OsbleSaveComplete(object sender, EventArgs e) { this.DialogResult = true; OSBLEStateEventArgs osea = e as OSBLEStateEventArgs; // Make sure we do a state refresh (sender as OSBLEState).RefreshAsync(); if (osea.Success) { MessageBox.Show("Save complete"); } else { MessageBox.Show("The save operation could not be completed. It is recommended that you " + "either try again or save your work to disk and then upload it to OSBLE through the " + "web interface."); } }
private void State_OnSaveComplete(object sender, EventArgs e) { // Remove the event listener m_state.OnSaveComplete -= this.State_OnSaveComplete; this.DialogResult = true; OSBLEStateEventArgs osea = e as OSBLEStateEventArgs; if (osea.Success) { MessageBox.Show("Save complete"); } else { MessageBox.Show("The save operation could not be completed. It is recommended that you " + "either try again or save your work to disk and then upload it to OSBLE through the " + "web interface."); } }