Exemplo n.º 1
0
        public static InvokeFilters GetFilters(BPSEvent ev)
        {
            if (ev.Domain != Navigator.Domain)
            {
                throw new ArgumentException("BPSEvent is not a navigator event");
            }
            if ((NavigatorEvents)ev.Code != NavigatorEvents.InvokeGetFiltersResult)
            {
                throw new ArgumentException("BPSEvent is not a invoke get-filters event");
            }
            var ptr    = ev.DangerousGetHandle();
            var id     = Marshal.PtrToStringAnsi(Navigator.navigator_event_get_id(ptr));
            var target = Marshal.PtrToStringAnsi(navigator_invoke_event_get_filters_target(ptr));
            var count  = navigator_invoke_event_get_filters_count(ptr);

            var filters = new string[count];

            for (var i = 0; i < count; i++)
            {
                filters[i] = Marshal.PtrToStringAnsi(navigator_invoke_event_get_filter(ptr, i));
            }

            var result = new InvokeFilters(target, id);

            result.filters = filters;
            return(result);
        }
Exemplo n.º 2
0
        public static InvokeFilters GetFilters(BPSEvent ev)
        {
            if (ev.Domain != Navigator.Domain)
            {
                throw new ArgumentException("BPSEvent is not a navigator event");
            }
            if ((NavigatorEvents)ev.Code != NavigatorEvents.InvokeGetFiltersResult)
            {
                throw new ArgumentException("BPSEvent is not a invoke get-filters event");
            }
            var ptr = ev.DangerousGetHandle();
            var id = Marshal.PtrToStringAnsi(Navigator.navigator_event_get_id(ptr));
            var target = Marshal.PtrToStringAnsi(navigator_invoke_event_get_filters_target(ptr));
            var count = navigator_invoke_event_get_filters_count(ptr);

            var filters = new string[count];
            for (var i = 0; i < count; i++)
            {
                filters[i] = Marshal.PtrToStringAnsi(navigator_invoke_event_get_filter(ptr, i));
            }

            var result = new InvokeFilters(target, id);
            result.filters = filters;
            return result;
        }