예제 #1
0
        public static DialogEvent GetDialogEvent(BPSEvent ev)
        {
            if (ev.Domain != Dialog.Domain)
            {
                throw new ArgumentException("BPSEvent is not a dialog event");
            }
            if (ev.Code != DIALOG_RESPONSE) // There is only one dialog event type right now, so do a simple check against it
            {
                throw new ArgumentException("BPSEvent is an unknown dialog event");
            }
            var    evPtr  = ev.DangerousGetHandle();
            var    diaPtr = dialog_event_get_dialog_instance(evPtr);
            Dialog dia;

            if (!dialogs.TryGetValue(diaPtr, out dia))
            {
                dia = new GenericDialog(diaPtr);
            }
            dia.isVisible = false;
            return(dia.GetEventForDialog(evPtr));
        }
예제 #2
0
 public static DialogEvent GetDialogEvent(BPSEvent ev)
 {
     if (ev.Domain != Dialog.Domain)
     {
         throw new ArgumentException("BPSEvent is not a dialog event");
     }
     if (ev.Code != DIALOG_RESPONSE) // There is only one dialog event type right now, so do a simple check against it
     {
         throw new ArgumentException("BPSEvent is an unknown dialog event");
     }
     var evPtr = ev.DangerousGetHandle();
     var diaPtr = dialog_event_get_dialog_instance(evPtr);
     Dialog dia;
     if (!dialogs.TryGetValue(diaPtr, out dia))
     {
         dia = new GenericDialog(diaPtr);
     }
     dia.isVisible = false;
     return dia.GetEventForDialog(evPtr);
 }