public DashboardWindow(IMission mission, IDeployment deployment) { InitializeComponent(); Mission = mission; Deployment = deployment; deviceManager = (Application.Current as App).DeviceManager; if (deployment.Devices.Count > 0) { deviceManager.ActiveDevice = deployment.Devices[0]; deviceManager.ActiveDevice.MessageReceived += ActiveDeviceMessageReceived; } controllerAxisChangedHandler = ControllerAxisChanged; controllerConnectionChangedHandler = ControllerConnectionChanged; bitmapFrameCapturedHandler = VideoDisplayWindowBitmapFrameCaptured; this.Title = String.Format("Dashboard - {0} > {1}", mission.Name, deployment.DateTime.ToString()); YawOffsetSlider.ValueChanged += YawOffsetSliderValueChanged; PitchOffsetSlider.ValueChanged += PitchOffsetSliderValueChanged; FinRangeSlider.ValueChanged += FinRangeSliderValueChanged; TopFinOffsetSlider.ValueChanged += TopFinOffsetSliderValueChanged; RightFinOffsetSlider.ValueChanged += RightFinOffsetSliderValueChanged; BottomFinOffsetSlider.ValueChanged += BottomFinOffsetSliderValueChanged; LeftFinOffsetSlider.ValueChanged += LeftFinOffsetSliderValueChanged; illuminationSlider.ValueChanged += IlluminationSliderValueChanged; focusSlider.ValueChanged += focusSliderValueChanged; buoyancySlider.ValueChanged += buoyancySliderValueChanged; }
public DashboardWindow(IMission mission, IDeployment deployment) { InitializeComponent(); Mission = mission; Deployment = deployment; deviceManager = (Application.Current as App).DeviceManager; if (deployment.Devices.Count > 0) { deviceManager.ActiveDevice = deployment.Devices[0]; deviceManager.ActiveDevice.MessageReceived += ActiveDeviceMessageReceived; } controllerAxisChangedHandler = ControllerAxisChanged; controllerConnectionChangedHandler = ControllerConnectionChanged; bitmapFrameCapturedHandler = VideoDisplayWindowBitmapFrameCaptured; this.Title = String.Format("Dashboard - {0} > {1}", mission.Name, deployment.DateTime.ToString()); YawOffsetSlider.ValueChanged += YawOffsetSliderValueChanged; PitchOffsetSlider.ValueChanged += PitchOffsetSliderValueChanged; FinRangeSlider.ValueChanged += FinRangeSliderValueChanged; TopFinOffsetSlider.ValueChanged += TopFinOffsetSliderValueChanged; RightFinOffsetSlider.ValueChanged += RightFinOffsetSliderValueChanged; BottomFinOffsetSlider.ValueChanged += BottomFinOffsetSliderValueChanged; LeftFinOffsetSlider.ValueChanged += LeftFinOffsetSliderValueChanged; illuminationSlider.ValueChanged += IlluminationSliderValueChanged; focusSlider.ValueChanged += focusSliderValueChanged; buoyancySlider.ValueChanged += buoyancySliderValueChanged; }
protected void OnControllerAxisChanged(ControllerJoystick joystick, ControllerJoystickAxis axis, byte oldValue, byte newValue) { if (AxisChanged != null) { ControllerAxisChangedHandler eventHandler = AxisChanged; Delegate[] delegates = eventHandler.GetInvocationList(); foreach (ControllerAxisChangedHandler handler in delegates) { DispatcherObject dispatcherObject = handler.Target as DispatcherObject; if (dispatcherObject != null && !dispatcherObject.CheckAccess()) { dispatcherObject.Dispatcher.Invoke(DispatcherPriority.DataBind, handler, joystick, axis, oldValue, newValue); } else { handler(joystick, axis, oldValue, newValue); } } } }