Exemple #1
0
        void PrintDeviceEvents(neodevice_t device)
        {
            neoevent_t events     = icsneocsharp.new_neoevent_t_array(99);
            int        eventCount = 99;

            if (icsneocsharp.icsneo_getDeviceEvents(device, events, ref eventCount))
            {
                if (eventCount == 1)
                {
                    neoevent_t evt = icsneocsharp.neoevent_t_array_getitem(events, 0);
                    System.Console.WriteLine("1 device event found!");
                    System.Console.WriteLine("Event 0x" + evt.eventNumber + ": " + evt.description);
                }
                else
                {
                    System.Console.WriteLine(eventCount + " device events found!");
                    for (var i = 0; i < eventCount; ++i)
                    {
                        neoevent_t evt = icsneocsharp.neoevent_t_array_getitem(events, i);
                        System.Console.WriteLine("Event 0x" + evt.eventNumber + ": " + evt.description);
                    }
                }
            }
            else
            {
                System.Console.WriteLine("Failed to get API events!");
            }
            icsneocsharp.delete_neoevent_t_array(events);
        }
    public static neoevent_t new_neoevent_t_array(int nelements)
    {
        global::System.IntPtr cPtr = icsneocsharpPINVOKE.new_neoevent_t_array(nelements);
        neoevent_t            ret  = (cPtr == global::System.IntPtr.Zero) ? null : new neoevent_t(cPtr, false);

        return(ret);
    }
 public static void neoevent_t_array_setitem(neoevent_t ary, int index, neoevent_t value)
 {
     icsneocsharpPINVOKE.neoevent_t_array_setitem(neoevent_t.getCPtr(ary), index, neoevent_t.getCPtr(value));
     if (icsneocsharpPINVOKE.SWIGPendingException.Pending)
     {
         throw icsneocsharpPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #4
0
        void PrintLastError()
        {
            neoevent_t error = new neoevent_t();

            if (icsneocsharp.icsneo_getLastError(error))
            {
                System.Console.WriteLine("Error 0x" + error.eventNumber + ": " + error.description);
            }
            else
            {
                System.Console.WriteLine("No errors found!");
            }
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(neoevent_t obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
    public static neoevent_t neoevent_t_array_getitem(neoevent_t ary, int index)
    {
        neoevent_t ret = new neoevent_t(icsneocsharpPINVOKE.neoevent_t_array_getitem(neoevent_t.getCPtr(ary), index), true);

        return(ret);
    }
 public static void delete_neoevent_t_array(neoevent_t ary)
 {
     icsneocsharpPINVOKE.delete_neoevent_t_array(neoevent_t.getCPtr(ary));
 }
    public static bool icsneo_getLastError(neoevent_t error)
    {
        bool ret = icsneocsharpPINVOKE.icsneo_getLastError(neoevent_t.getCPtr(error));

        return(ret);
    }
    public static bool icsneo_getDeviceEvents(neodevice_t device, neoevent_t events, ref int size)
    {
        bool ret = icsneocsharpPINVOKE.icsneo_getDeviceEvents(neodevice_t.getCPtr(device), neoevent_t.getCPtr(events), ref size);

        return(ret);
    }
    public static bool icsneo_getEvents(neoevent_t events, ref int size)
    {
        bool ret = icsneocsharpPINVOKE.icsneo_getEvents(neoevent_t.getCPtr(events), ref size);

        return(ret);
    }