protected virtual void OnPostMessageReceived(object sender, PostMessageListenerEventArgs e) { EventHandler <PostMessageListenerEventArgs> handler = PostMessageListener; if (handler != null) { handler(sender, e); } }
// This method is called when SendFax fires the Click event so that we can // retrieve the results from it. private void GetSendFaxResults(PostMessageListenerEventArgs args) { if (args.Message.eventType == "mhw.fax.send.success") { NotificationService.ShowBalloonInfo("Print to Fax succeeded"); } else if (args.Message.eventType == "mhw.fax.send.cancelled") { // Cancelled. ////NotificationService.ShowBalloonWarning( "Print to Fax was cancelled." ); } else { NotificationService.ShowBalloonInfo("Send Fax Error: {0}", args.Message.data.message); } // Close the Drive picker form in a cross thread acceptable way. BeginInvoke((MethodInvoker)(() => sendFax.Dispose())); }
// This method is called when DrivePicker fires the Click event so that we can // retrieve the results from it. private void GetDrivePickerResults(PostMessageListenerEventArgs args) { if (args.Message.eventType == "mhw.drive.select.success") { // NOTE: If the drive-select-dialog returns a null folder selection then that needs to be interpreted as the root drive folder. // To upload to the root folder the account ID needs to be sent as the folder ID instead of null. uploadDriveItemId = args.Message.data.driveItemId ?? userSession.ActingAsAccount.AccountId; isDrivePickerSuccess = true; } else if (args.Message.eventType == "mhw.drive.select.cancelled") { // Cancelled. isDrivePickerSuccess = false; } else { isDrivePickerSuccess = false; NotificationService.ShowBalloonError("Drive picker error: {0}", args.Message.data.message); } // Close the Drive picker form in a cross thread acceptable way. BeginInvoke((MethodInvoker) delegate { drivePicker.Dispose(); }); }
public void ResultMessageHandler(object sender, PostMessageListenerEventArgs args) { // Fire event. OnClick(args); }