SND\AstrorEnales_cp 5505f7dcbf - Added PlatformSystem Plugins layer
- Started Windows, Metro and Linux Platform-Plugins
- Moved the RecordingSample to the Samples folder
- Started two samples for using the graphics device in a WinForms and Wpf Editor
- Refactorings in the AddIn-System
- Moved the Window initialization-code to the Platform modules
- Changed the License text in all code files which is now way smaller
- Started ProjectConverter tool which converts all the projects and solution to the target configuration
- Changed the SupportedPlatform names in the Resource files
- Changed the WIN8 define to WINDOWSMETRO which is actually meant
- Removed NLog and started our own Logger class
- Many more stuff...
2012-08-09 09:45:04 +00:00

106 lines
2.3 KiB
C#

using ANX.Framework.NonXNA;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.InputDevices.Standard
{
public class Creator : IInputSystemCreator
{
private IKeyboard keyboard;
private IMouse mouse;
public string Name
{
get
{
return "Standard";
}
}
public int Priority
{
get { return 0; }
}
public bool IsSupported
{
get
{
return true;
}
}
public void RegisterCreator(AddInSystemFactory factory)
{
Logger.Info("adding Standard InputSystem creator to creator collection of AddInSystemFactory");
factory.AddCreator(this);
}
public IGamePad GamePad
{
get
{
Logger.Info("returning a new GamePad device");
AddInSystemFactory.Instance.PreventSystemChange(
AddInType.InputSystem);
return InputDeviceFactory.Instance.GetDefaultGamePad();
}
}
public IMouse Mouse
{
get
{
if (this.mouse == null)
{
this.mouse = InputDeviceFactory.Instance.GetDefaultMouse();
if (this.mouse == null)
{
throw new NoInputDeviceException("couldn't find a default mouse device creator. Unable to create a mouse instance.");
}
Logger.Info("created a new Mouse device");
AddInSystemFactory.Instance.PreventSystemChange(
AddInType.InputSystem);
}
return this.mouse;
}
}
public IKeyboard Keyboard
{
get
{
if (this.keyboard == null)
{
this.keyboard = InputDeviceFactory.Instance.GetDefaultKeyboard();
if (this.keyboard == null)
{
throw new NoInputDeviceException("couldn't find a default keyboard device creator. Unable to create a keyboard instance.");
}
Logger.Info("created a new Keyboard device");
AddInSystemFactory.Instance.PreventSystemChange(
AddInType.InputSystem);
}
return this.keyboard;
}
}
#if XNAEXT
public IMotionSensingDevice MotionSensingDevice
{
get
{
Logger.Info("returning a new MotionSensingDevice device");
AddInSystemFactory.Instance.PreventSystemChange(
AddInType.InputSystem);
return InputDeviceFactory.Instance.GetDefaultMotionSensingDevice();
}
}
#endif
}
}