1 Star 0 Fork 1

ZxfBugProgrammer/KeyboardSplitterXbox

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SplitterBase.cs 3.48 KB
一键复制 编辑 原始数据 按行查看 历史
djlastnight 提交于 2017-09-12 20:35 +08:00 . Updated to version 2.0.0.0
namespace SplitterCore
{
using System;
using System.Collections.Generic;
using System.Windows;
using SplitterCore.Emulation;
using SplitterCore.Input;
public abstract class SplitterBase : DependencyObject, ISplitter
{
public static readonly DependencyProperty InputManagerProperty =
DependencyProperty.Register(
"InputManager",
typeof(IInputManager),
typeof(SplitterBase),
new PropertyMetadata(null));
public static readonly DependencyProperty EmulationManagerProperty =
DependencyProperty.Register(
"EmulationManager",
typeof(IEmulationManager),
typeof(SplitterBase),
new PropertyMetadata(null));
public static readonly DependencyProperty ShouldBlockKeyboardsProperty =
DependencyProperty.Register(
"ShouldBlockKeyboards",
typeof(bool),
typeof(SplitterBase),
new PropertyMetadata(true));
public static readonly DependencyProperty ShouldBlockMiceProperty =
DependencyProperty.Register(
"ShouldBlockMice",
typeof(bool),
typeof(SplitterBase),
new PropertyMetadata(false));
public static readonly DependencyProperty AssignedInputDevicesProperty =
DependencyProperty.Register(
"AssignedInputDevices",
typeof(List<InputDevice>),
typeof(SplitterBase),
new PropertyMetadata(null));
protected SplitterBase()
{
this.AssignedInputDevices = new List<InputDevice>();
}
protected SplitterBase(IInputManager inputManager, IEmulationManager emulationManager)
: this()
{
if (inputManager == null)
{
throw new ArgumentNullException("inputManger");
}
if (emulationManager == null)
{
throw new ArgumentNullException("emulationManager");
}
this.InputManager = inputManager;
this.EmulationManager = emulationManager;
}
public IInputManager InputManager
{
get { return (IInputManager)this.GetValue(InputManagerProperty); }
set { this.SetValue(InputManagerProperty, value); }
}
public IEmulationManager EmulationManager
{
get { return (IEmulationManager)this.GetValue(EmulationManagerProperty); }
set { this.SetValue(EmulationManagerProperty, value); }
}
public bool ShouldBlockKeyboards
{
get { return (bool)this.GetValue(ShouldBlockKeyboardsProperty); }
set { this.SetValue(ShouldBlockKeyboardsProperty, value); }
}
public bool ShouldBlockMice
{
get { return (bool)this.GetValue(ShouldBlockMiceProperty); }
set { this.SetValue(ShouldBlockMiceProperty, value); }
}
public List<InputDevice> AssignedInputDevices
{
get { return (List<InputDevice>)this.GetValue(AssignedInputDevicesProperty); }
set { this.SetValue(AssignedInputDevicesProperty, value); }
}
public virtual void Destroy()
{
if (this.InputManager != null)
{
this.InputManager.Destroy();
}
if (this.EmulationManager != null)
{
this.EmulationManager.Destroy();
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zxfbugprogrammer/KeyboardSplitterXbox.git
git@gitee.com:zxfbugprogrammer/KeyboardSplitterXbox.git
zxfbugprogrammer
KeyboardSplitterXbox
KeyboardSplitterXbox
master

搜索帮助