Example #1
0
        /// <summary>
        /// Adds an axis with a specified name
        /// </summary>
        /// <param name="name">Axis name</param>
        public Axis CreateAxis(string name)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");

            if (_axesMap.ContainsKey(name))
                throw new Exception(string.Format("An axis named {0} already exists in this virtual input", name));

            Axis axis = new Axis();
            _axes.Add(axis);
            _axesMap.Add(name, _axes.Count - 1);
            axis.Owner = this;

            return axis;
        }
Example #2
0
 /// <summary>
 /// Constructor of AxisCommand
 /// </summary>
 /// <param name="axis">Axis instance</param>
 /// <param name="axisEvent">Event to check for</param>
 internal AxisCommand(Axis axis, AxisEventType axisEvent)
 {
     _axis = axis;
     _axisEvent = axisEvent;
     AssignCheckMethod();
 }