public static InGameAxAssgn ShowAxisAssignWindow(InGameAxAssgn axisAssign, object sender) { AxisAssignWindow ownWindow = new AxisAssignWindow(axisAssign, sender); ownWindow.ShowDialog(); axisAssign = ownWindow.axisAssign; return(axisAssign); }
/// <summary> /// Callback When clicked "Assign" Button. Opens AxisAssignWindow. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Assign_Click(object sender, RoutedEventArgs e) { AxisMovingTimer.Stop(); string whocalledwindow = ((System.Windows.Controls.Button)sender).Name; InGameAxAssgn axisAssign = new InGameAxAssgn(); axisAssign = AxisAssignWindow.ShowMiniWindow((InGameAxAssgn)inGameAxis[whocalledwindow], sender); // Reset PhysicalAxis previously assigned to same axis // In case of axis has been unassigned and saved. for (int i = 0; i < deviceControl.devList.Count; i++) { deviceControl.joyAssign[i].ResetPreviousAxis(whocalledwindow); } if (deviceControl.mouseWheelAssign.GetAxisName() == whocalledwindow) { deviceControl.mouseWheelAssign = new JoyAssgn.AxAssgn(); } // When axis has been assigned. if (axisAssign.GetDeviceNumber() > -1) { deviceControl.joyAssign[axisAssign.GetDeviceNumber()].axis[axisAssign.GetPhysicalNumber()] = new JoyAssgn.AxAssgn(whocalledwindow, axisAssign); } if (axisAssign.GetDeviceNumber() == -2) { wheelValue = 0; deviceControl.mouseWheelAssign = new JoyAssgn.AxAssgn(whocalledwindow, axisAssign); } joyAssign_2_inGameAxis(); ResetAssgnWindow(); AxisMovingTimer.Start(); }