public void Run(IBackgroundTaskInstance taskInstance) { var options = new ControllerOptions { StatusLedNumber = LedGpio }; var controller = new Core.Controller(options); controller.RunAsync(taskInstance); }
public MainPage() { InitializeComponent(); Log.Instance = new TextBoxLogger(LogTextBox); var options = new ControllerOptions { ConfigurationType = typeof(Initializer), ContainerConfigurator = new ContainerConfigurator(this), HttpServerPort = 1025 }; _controller = new Core.Controller(options); // The app is only available from other machines. https://msdn.microsoft.com/en-us/library/windows/apps/Hh780593.aspx StoragePathTextBox.Text = StoragePath.Root; AppPathTextBox.Text = StoragePath.AppRoot; }
public HealthService( ControllerOptions controllerOptions, IPi2GpioService pi2GpioService, ITimerService timerService, ISystemInformationService systemInformationService) { if (controllerOptions == null) throw new ArgumentNullException(nameof(controllerOptions)); if (timerService == null) throw new ArgumentNullException(nameof(timerService)); if (systemInformationService == null) throw new ArgumentNullException(nameof(systemInformationService)); _systemInformationService = systemInformationService; if (controllerOptions.StatusLedNumber.HasValue) { _led = pi2GpioService.GetOutput(controllerOptions.StatusLedNumber.Value); _ledTimeout.Start(TimeSpan.FromMilliseconds(1)); } timerService.Tick += Tick; }
public MessageOptions(ControllerOptions _controllerOptions) { controllerOptions = _controllerOptions; }
// Because I don't understand the whole Equals, GetHashCode C# mess // I named this SameValues public bool SameValues(ControllerOptions other) { return controllerType == other.controllerType && provideOrientation == other.provideOrientation && provideAcceleration == other.provideAcceleration && provideRotationRate == other.provideRotationRate && askForName == other.askForName && showMenu == other.showMenu; }
public ControllerOptions(ControllerOptions src) { controllerType = src.controllerType; provideOrientation = src.provideOrientation; provideAcceleration = src.provideAcceleration; provideRotationRate = src.provideRotationRate; askForName = src.askForName; showMenu = src.showMenu; }
void Update() { // Seems kind of dumb to do it this way but it's easier for users if (!m_oldControllerOptions.SameValues(controllerOptions)) { m_oldControllerOptions = new ControllerOptions(controllerOptions); SendControllerOptions(); } if (m_oldColor != color) { m_oldColor = color; SendColor(); } }
.RegisterSolutionController(ControllerOptions, ControllerAction);
.RegisterCapabilityController(ControllerOptions, ControllerAction) .RegisterSolutionListController(ControllerOptions, ControllerAction)
public Controller(ControllerOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); _options = options; }
public Controller(ControllerOptions options) { Options = options; }
// Because I don't understand the whole Equals, GetHashCode C# mess // I named this SameValues public bool SameValues(ControllerOptions other) { return controllerType == other.controllerType && provideOrientation == other.provideOrientation && provideAcceleration == other.provideAcceleration && provideRotationRate == other.provideRotationRate; }
public ControllerOptions(ControllerOptions src) { controllerType = src.controllerType; provideOrientation = src.provideOrientation; provideAcceleration = src.provideAcceleration; provideRotationRate = src.provideRotationRate; }
public GameController getController(ControllerOptions controller) { switch (controller) { case ControllerOptions.Mouse: return new MouseController(); case ControllerOptions.Keyboard: return new KeyboardController(); case ControllerOptions.GamePad: return new GamePadController(); default: return new MouseController(); } }
/* Ignore these aspects of the interface. We only want to edit the print functions. */ public ControllerOptions SetControllerOptions(ControllerOptions controllerOptions) => controllerOptions;