예제 #1
0
        /// <summary>
        ///   Returns all <see cref = "Mapping" />s from the <see cref = "MappingCollection" /> that are of a specific <see cref = "System.Type" />.
        /// </summary>
        /// <param name = "proto"><see cref = "System.Type" /> of <see cref = "Mapping" /> to return.  All <see cref = "Mapping" />s in the <see cref = "MappingCollection" /> that are of this <see cref = "System.Type" /> will be returned.</param>
        /// <returns>A <see cref = "MappingCollection" /> that is a subset of this <see cref = "MappingCollection" />, containing only <see cref = "Mapping" />s of the specified <see cref = "System.Type" />.</returns>
        private MappingCollection GetAllOfType(Type proto)
        {
            var toReturn = new MappingCollection();

            foreach (Mapping mapping in this)
            {
                if (proto.IsInstanceOfType(mapping))
                {
                    toReturn.Add(mapping);
                }
            }
            return(toReturn);
        }
예제 #2
0
 /// <summary>
 ///   Associates a set of <see cref = "Mapping" />s (a <see cref = "MappingCollection" />) with a specific PPJoy <see cref = "Device" /> in a specific <see cref = "JoystickMapScope" />.
 /// </summary>
 /// <param name = "scope">The <see cref = "JoystickMapScope" />
 ///   in which to store the new custom <see cref = "Mapping" />s.</param>
 /// <param name = "newMappings">A <see cref = "MappingCollection" /> object
 ///   containing the new <see cref = "Mapping" />s to associate with
 ///   the specified <paramref name = "scope" />.</param>
 /// <seealso cref = "MappingCollection" />
 /// <seealso cref = "Mapping" />
 /// <seealso cref = "JoystickMapScope" />
 public void SetMappings(JoystickMapScope scope, MappingCollection newMappings)
 {
     new DeviceManager().SetDeviceMappings(LptNum, DeviceType, UnitNum, scope, newMappings);
 }
예제 #3
0
 /// <summary>
 ///   Associates a set of <see cref = "Mapping" />s (a <see cref = "MappingCollection" />) with a specific PPJoy <see cref = "Device" />.
 /// </summary>
 /// <param name = "newMappings">A <see cref = "MappingCollection" /> object
 ///   containing the new <see cref = "Mapping" />s to associate with
 ///   the <see cref = "Device" />.</param>
 /// <seealso cref = "MappingCollection" />
 /// <seealso cref = "Mapping" />
 /// <seealso cref = "JoystickMapScope" />
 public void SetMappings(MappingCollection newMappings)
 {
     SetMappings(JoystickMapScope.Device, newMappings);
 }