/// <summary> /// Initializes a new instance of the <see cref="ChannelDriver"/> class. /// </summary> /// <param name="channelBridge">The channel bridge. Cannot be <c>null</c>.</param> /// <exception cref="System.ArgumentNullException"> /// The exception that is thrown when <paramref name="channelBridge"/> is null. /// </exception> private ChannelDriver(IChannelBridge channelBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { // Contract.Requires<ArgumentNullException>(channelBridge != null, "channelBridge"); // Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); _channelBridge = channelBridge; _myoErrorHandlerDriver = myoErrorHandlerDriver; }
public static IMyoCommand Create(IMyoErrorHandlerDriver myoErrorHandlerDriver, MyoCommandDelegate command) { ////Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); ////Contract.Requires<ArgumentNullException>(command != null, "command"); Contract.Ensures(Contract.Result <IMyoCommand>() != null); return(new MyoCommand(myoErrorHandlerDriver, command)); }
/// <summary> /// Creates a new <see cref="IChannelDriver"/> instance. /// </summary> /// <param name="channelBridge">The channel bridge. Cannot be <c>null</c>.</param> /// <param name="myoErrorHandlerDriver">The error handler driver. Cannot be <c>null</c>.</param> /// <returns>Returns a new <see cref="IChannelDriver"/> instance.</returns> /// <exception cref="System.ArgumentNullException"> /// The exception that is thrown when <paramref name="channelBridge"/> or <paramref name="myoErrorHandlerDriver" is null. /// </exception> public static IChannelDriver Create(IChannelBridge channelBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { // Contract.Requires<ArgumentNullException>(channelBridge != null, "channelBridge"); // Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Ensures(Contract.Result <IChannelDriver>() != null); return(new ChannelDriver(channelBridge, myoErrorHandlerDriver)); }
private MyoCommand(IMyoErrorHandlerDriver myoErrorHandlerDriver, MyoCommandDelegate command) { ////Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); ////Contract.Requires<ArgumentNullException>(command != null, "command"); _myoErrorHandlerDriver = myoErrorHandlerDriver; _command = command; }
/// <summary> /// Creates a new <see cref="IChannelDriver"/> instance. /// </summary> /// <param name="channelBridge">The channel bridge. Cannot be <c>null</c>.</param> /// <param name="myoErrorHandlerDriver">The error handler driver. Cannot be <c>null</c>.</param> /// <returns>Returns a new <see cref="IChannelDriver"/> instance.</returns> /// <exception cref="System.ArgumentNullException"> /// The exception that is thrown when <paramref name="channelBridge"/> or <paramref name="myoErrorHandlerDriver" is null. /// </exception> public static IChannelDriver Create(IChannelBridge channelBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { Contract.Requires<ArgumentNullException>(channelBridge != null, "channelBridge"); Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Ensures(Contract.Result<IChannelDriver>() != null); return new ChannelDriver(channelBridge, myoErrorHandlerDriver); }
private MyoCommand(IMyoErrorHandlerDriver myoErrorHandlerDriver, MyoCommandDelegate command) { Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Requires<ArgumentNullException>(command != null, "command"); _myoErrorHandlerDriver = myoErrorHandlerDriver; _command = command; }
public static IMyoCommand Create(IMyoErrorHandlerDriver myoErrorHandlerDriver, MyoCommandDelegate command) { Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Requires<ArgumentNullException>(command != null, "command"); Contract.Ensures(Contract.Result<IMyoCommand>() != null); return new MyoCommand(myoErrorHandlerDriver, command); }
/// <summary> /// Initializes a new instance of the <see cref="ChannelDriver"/> class. /// </summary> /// <param name="channelBridge">The channel bridge. Cannot be <c>null</c>.</param> /// <exception cref="System.ArgumentNullException"> /// The exception that is thrown when <paramref name="channelBridge"/> is null. /// </exception> private ChannelDriver(IChannelBridge channelBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { Contract.Requires<ArgumentNullException>(channelBridge != null, "channelBridge"); Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); _channelBridge = channelBridge; _myoErrorHandlerDriver = myoErrorHandlerDriver; }
/// <summary> /// Initializes a new instance of the <see cref="MyoDeviceDriver" /> class. /// </summary> /// <param name="handle">The handle to the Myo.</param> /// <param name="myoDeviceBridge">An instance of <see cref="IMyoDeviceBridge" /> for communicating with the device. Cannot be null.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be null.</param> /// <exception cref="System.ArgumentException">The exception that is thrown when the handle is not set.</exception> /// <exception cref="System.ArgumentNullException">The exception that is thrown when the <paramref name="myoDeviceBridge" /> or <paramref name="myoErrorHandlerDriver" /> is <c>null</c>.</exception> private MyoDeviceDriver(IntPtr handle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { Contract.Requires<ArgumentException>(handle != IntPtr.Zero, "handle"); Contract.Requires<ArgumentNullException>(myoDeviceBridge != null, "myoDeviceBridge"); Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); _handle = handle; _myoDeviceBridge = myoDeviceBridge; _myoErrorHandlerDriver = myoErrorHandlerDriver; }
/// <summary> /// Initializes a new instance of the <see cref="MyoDeviceDriver" /> class. /// </summary> /// <param name="handle">The handle to the Myo.</param> /// <param name="myoDeviceBridge">An instance of <see cref="IMyoDeviceBridge" /> for communicating with the device. Cannot be null.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be null.</param> /// <exception cref="System.ArgumentException">The exception that is thrown when the handle is not set.</exception> /// <exception cref="System.ArgumentNullException">The exception that is thrown when the <paramref name="myoDeviceBridge" /> or <paramref name="myoErrorHandlerDriver" /> is <c>null</c>.</exception> private MyoDeviceDriver(IntPtr handle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { //Contract.Requires<ArgumentException>(handle != IntPtr.Zero, "handle"); //Contract.Requires<ArgumentNullException>(myoDeviceBridge != null, "myoDeviceBridge"); //Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); _handle = handle; _myoDeviceBridge = myoDeviceBridge; _myoErrorHandlerDriver = myoErrorHandlerDriver; }
/// <summary> /// Creates a new <see cref="IMyoDeviceDriver" /> instance. /// </summary> /// <param name="handle">The handle to the Myo.</param> /// <param name="myoDeviceBridge">An instance of <see cref="IMyoDeviceBridge" /> for communicating with the device. Cannot be null.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be null.</param> /// <returns></returns> /// <exception cref="System.ArgumentException">The exception that is thrown when the handle is not set.</exception> /// <exception cref="System.ArgumentNullException">The exception that is thrown when the <paramref name="myoDeviceBridge" /> or <paramref name="myoErrorHandlerDriver" /> is <c>null</c>.</exception> public static IMyoDeviceDriver Create(IntPtr handle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { Contract.Requires<ArgumentException>(handle != IntPtr.Zero, "handle"); Contract.Requires<ArgumentNullException>(myoDeviceBridge != null, "myoDeviceBridge"); Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Ensures(Contract.Result<IMyoDeviceDriver>() != null); return new MyoDeviceDriver( handle, myoDeviceBridge, myoErrorHandlerDriver); }
/// <summary> /// Creates a new <see cref="IMyoDeviceDriver" />. /// </summary> /// <param name="myoHandle">The Myo handle.</param> /// <param name="myoDeviceBridge">The Myo device bridge. Cannot be <c>null</c>.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be <c>null</c>.</param> /// <returns> /// Returns a new <see cref="IMyoDeviceDriver" /> instance. /// </returns> protected virtual IMyoDeviceDriver CreateMyoDeviceDriver(IntPtr myoHandle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { return(MyoDeviceDriver.Create(myoHandle, myoDeviceBridge, myoErrorHandlerDriver)); }
/// <summary> /// Creates a new <see cref="IMyoDeviceDriver" /> instance. /// </summary> /// <param name="handle">The handle to the Myo.</param> /// <param name="myoDeviceBridge">An instance of <see cref="IMyoDeviceBridge" /> for communicating with the device. Cannot be null.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be null.</param> /// <returns></returns> /// <exception cref="System.ArgumentException">The exception that is thrown when the handle is not set.</exception> /// <exception cref="System.ArgumentNullException">The exception that is thrown when the <paramref name="myoDeviceBridge" /> or <paramref name="myoErrorHandlerDriver" /> is <c>null</c>.</exception> public static IMyoDeviceDriver Create(IntPtr handle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { //Contract.Requires<ArgumentException>(handle != IntPtr.Zero, "handle"); //Contract.Requires<ArgumentNullException>(myoDeviceBridge != null, "myoDeviceBridge"); //Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Ensures(Contract.Result <IMyoDeviceDriver>() != null); return(new MyoDeviceDriver( handle, myoDeviceBridge, myoErrorHandlerDriver)); }
/// <summary> /// Creates a new <see cref="IChannelDriver"/> instance. /// </summary> /// <param name="channelBridge">The channel bridge. Cannot be <c>null</c>.</param> /// <param name="myoErrorHandlerDriver">The error handler driver. Cannot be <c>null</c>.</param> /// <returns>Returns a new <see cref="IChannelDriver"/> instance.</returns> /// <exception cref="System.ArgumentNullException"> /// The exception that is thrown when <paramref name="channelBridge"/> or <paramref name="myoErrorHandlerDriver" is null. /// </exception> public static IChannelDriver Create(IChannelBridge channelBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { return(new ChannelDriver(channelBridge, myoErrorHandlerDriver)); }
/// <summary> /// Initializes a new instance of the <see cref="ChannelDriver"/> class. /// </summary> /// <param name="channelBridge">The channel bridge. Cannot be <c>null</c>.</param> /// <exception cref="System.ArgumentNullException"> /// The exception that is thrown when <paramref name="channelBridge"/> is null. /// </exception> private ChannelDriver(IChannelBridge channelBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { _channelBridge = channelBridge; _myoErrorHandlerDriver = myoErrorHandlerDriver; }
/// <summary> /// Creates a new <see cref="IMyoDeviceDriver" /> instance. /// </summary> /// <param name="handle">The handle to the Myo.</param> /// <param name="myoDeviceBridge">An instance of <see cref="IMyoDeviceBridge" /> for communicating with the device. Cannot be null.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be null.</param> /// <returns></returns> /// <exception cref="System.ArgumentException">The exception that is thrown when the handle is not set.</exception> /// <exception cref="System.ArgumentNullException">The exception that is thrown when the <paramref name="myoDeviceBridge" /> or <paramref name="myoErrorHandlerDriver" /> is <c>null</c>.</exception> public static IMyoDeviceDriver Create(IntPtr handle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { return(new MyoDeviceDriver( handle, myoDeviceBridge, myoErrorHandlerDriver)); }
/// <summary> /// Creates a new <see cref="IMyoDeviceDriver" />. /// </summary> /// <param name="myoHandle">The Myo handle.</param> /// <param name="myoDeviceBridge">The Myo device bridge. Cannot be <c>null</c>.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be <c>null</c>.</param> /// <returns> /// Returns a new <see cref="IMyoDeviceDriver" /> instance. /// </returns> protected virtual IMyoDeviceDriver CreateMyoDeviceDriver(IntPtr myoHandle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { Contract.Requires<ArgumentException>(myoHandle != IntPtr.Zero, "The handle to the Myo must be set."); Contract.Requires<ArgumentNullException>(myoDeviceBridge != null, "myoDeviceBridge"); Contract.Requires<ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Ensures(Contract.Result<IMyoDeviceDriver>() != null); return MyoDeviceDriver.Create(myoHandle, myoDeviceBridge, myoErrorHandlerDriver); }
private MyoCommand(IMyoErrorHandlerDriver myoErrorHandlerDriver, MyoCommandDelegate command) { _myoErrorHandlerDriver = myoErrorHandlerDriver; _command = command; }
public static IMyoCommand Create(IMyoErrorHandlerDriver myoErrorHandlerDriver, MyoCommandDelegate command) { return(new MyoCommand(myoErrorHandlerDriver, command)); }
/// <summary> /// Creates a new <see cref="IMyoDeviceDriver" />. /// </summary> /// <param name="myoHandle">The Myo handle.</param> /// <param name="myoDeviceBridge">The Myo device bridge. Cannot be <c>null</c>.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be <c>null</c>.</param> /// <returns> /// Returns a new <see cref="IMyoDeviceDriver" /> instance. /// </returns> protected virtual IMyoDeviceDriver CreateMyoDeviceDriver(IntPtr myoHandle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { Contract.Requires <ArgumentException>(myoHandle != IntPtr.Zero, "The handle to the Myo must be set."); Contract.Requires <ArgumentNullException>(myoDeviceBridge != null, "myoDeviceBridge"); Contract.Requires <ArgumentNullException>(myoErrorHandlerDriver != null, "myoErrorHandlerDriver"); Contract.Ensures(Contract.Result <IMyoDeviceDriver>() != null); return(MyoDeviceDriver.Create(myoHandle, myoDeviceBridge, myoErrorHandlerDriver)); }
/// <summary> /// Initializes a new instance of the <see cref="MyoDeviceDriver" /> class. /// </summary> /// <param name="handle">The handle to the Myo.</param> /// <param name="myoDeviceBridge">An instance of <see cref="IMyoDeviceBridge" /> for communicating with the device. Cannot be null.</param> /// <param name="myoErrorHandlerDriver">The myo error handler driver. Cannot be null.</param> /// <exception cref="System.ArgumentException">The exception that is thrown when the handle is not set.</exception> /// <exception cref="System.ArgumentNullException">The exception that is thrown when the <paramref name="myoDeviceBridge" /> or <paramref name="myoErrorHandlerDriver" /> is <c>null</c>.</exception> private MyoDeviceDriver(IntPtr handle, IMyoDeviceBridge myoDeviceBridge, IMyoErrorHandlerDriver myoErrorHandlerDriver) { _handle = handle; _myoDeviceBridge = myoDeviceBridge; _myoErrorHandlerDriver = myoErrorHandlerDriver; }