コード例 #1
0
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            var options = new ControllerOptions
            {
                StatusLedNumber = LedGpio
            };

            var controller = new Core.Controller(options);
            controller.RunAsync(taskInstance);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
 public MessageOptions(ControllerOptions _controllerOptions)
 {
     controllerOptions = _controllerOptions;
 }
コード例 #5
0
 // 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;
 }
コード例 #6
0
 public ControllerOptions(ControllerOptions src)
 {
     controllerType = src.controllerType;
       provideOrientation = src.provideOrientation;
       provideAcceleration = src.provideAcceleration;
       provideRotationRate = src.provideRotationRate;
       askForName = src.askForName;
       showMenu = src.showMenu;
 }
コード例 #7
0
    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)
コード例 #10
0
ファイル: HFTGamepad.cs プロジェクト: Artars/SeedForSpeed
 public MessageOptions(ControllerOptions _controllerOptions)
 {
     controllerOptions = _controllerOptions;
 }
コード例 #11
0
        public Controller(ControllerOptions options)
        {
            if (options == null) throw new ArgumentNullException(nameof(options));

            _options = options;
        }
コード例 #12
0
 public Controller(ControllerOptions options)
 {
     Options = options;
 }
コード例 #13
0
ファイル: HFTGamepad.cs プロジェクト: amiruqdah/HackSC15
 // 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;
 }
コード例 #14
0
ファイル: HFTGamepad.cs プロジェクト: amiruqdah/HackSC15
 public ControllerOptions(ControllerOptions src)
 {
     controllerType = src.controllerType;
     provideOrientation = src.provideOrientation;
     provideAcceleration = src.provideAcceleration;
     provideRotationRate = src.provideRotationRate;
 }
コード例 #15
0
ファイル: Game1.cs プロジェクト: Huskyhond/Space-invaders
 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();
     }
 }
コード例 #16
0
 /* Ignore these aspects of the interface. We only want to edit the print functions. */
 public ControllerOptions SetControllerOptions(ControllerOptions controllerOptions) => controllerOptions;