public Device this[int index] { get { object error; var ptr = NativeMethods.rs2_create_device(m_instance, index, out error); return(new Device(ptr)); } }
/// <summary>Creates a device by index. The device object represents a physical camera and provides the means to manipulate it.</summary> /// <param name="index">The zero based index of device to retrieve</param> /// <returns>The requested device, should be released by rs2_delete_device</returns> public Device this[int index] { get { object error; var ptr = NativeMethods.rs2_create_device(Handle, index, out error); return(Device.Create <Device>(ptr, NativeMethods.rs2_delete_device)); } }
public IEnumerator <Device> GetEnumerator() { object error; int deviceCount = NativeMethods.rs2_get_device_count(m_instance, out error); for (int i = 0; i < deviceCount; i++) { var ptr = NativeMethods.rs2_create_device(m_instance, i, out error); yield return(new Device(ptr)); } }
/// <summary> /// Returns an iterable of devices in the list /// </summary> /// <returns>an iterable of devices in the list</returns> public IEnumerator <Device> GetEnumerator() { object error; int deviceCount = NativeMethods.rs2_get_device_count(Handle, out error); for (int i = 0; i < deviceCount; i++) { var ptr = NativeMethods.rs2_create_device(Handle, i, out error); yield return(Device.Create <Device>(ptr, NativeMethods.rs2_delete_device)); } }