Exemple #1
0
        public static InvokeQueryResult[] GetResults(BPSEvent ev)
        {
            if (ev.Domain != Navigator.Domain)
            {
                throw new ArgumentException("BPSEvent is not a navigator event");
            }
            if ((NavigatorEvents)ev.Code != NavigatorEvents.InvokeQueryResult)
            {
                throw new ArgumentException("BPSEvent is not a invoke query result event");
            }
            var ptr   = ev.DangerousGetHandle();
            var count = navigator_invoke_event_get_query_result_action_count(ptr);

            if (count < 0)
            {
                return(null);
            }
            else if (count == 0)
            {
                return(new InvokeQueryResult[0]);
            }
            //XXX Should this maybe be an enumeration? As in, someone is only looking for one particular element and don't care about the others... so we don't need to get "all of them"
            var results = new InvokeQueryResult[count];

            for (var i = 0; i < count; i++)
            {
                results[i] = new InvokeQueryResult(navigator_invoke_event_get_query_result_action(ptr, i), ev);
            }
            return(results);
        }
 public static InvokeQueryResult[] GetResults(BPSEvent ev)
 {
     if (ev.Domain != Navigator.Domain)
     {
         throw new ArgumentException("BPSEvent is not a navigator event");
     }
     if ((NavigatorEvents)ev.Code != NavigatorEvents.InvokeQueryResult)
     {
         throw new ArgumentException("BPSEvent is not a invoke query result event");
     }
     var ptr = ev.DangerousGetHandle();
     var count = navigator_invoke_event_get_query_result_action_count(ptr);
     if (count < 0)
     {
         return null;
     }
     else if (count == 0)
     {
         return new InvokeQueryResult[0];
     }
     //XXX Should this maybe be an enumeration? As in, someone is only looking for one particular element and don't care about the others... so we don't need to get "all of them"
     var results = new InvokeQueryResult[count];
     for (var i = 0; i < count; i++)
     {
         results[i] = new InvokeQueryResult(navigator_invoke_event_get_query_result_action(ptr, i), ev);
     }
     return results;
 }