/// <summary> /// Creates a monitor for a key binding /// </summary> /// <exception cref="ArgumentNullException">Thrown if binding or user are null</exception> public ICommandInputBindingMonitor CreateBindingMonitor( CommandKeyInputBinding binding, ICommandUser user ) { Arguments.CheckNotNull( binding, "binding" ); Arguments.CheckNotNull( user, "user" ); return new CommandKeyInputBindingMonitor( m_Control, binding, user ); }
/// <summary> /// Setup constructor /// </summary> /// <param name="control">Control to bind to</param> /// <param name="binding">Binding definition</param> /// <param name="user">Originating user</param> public CommandKeyInputBindingMonitor( Control control, CommandKeyInputBinding binding, ICommandUser user ) : base(binding, user) { m_Control = control; m_Key = ( Keys )Enum.Parse( typeof( Keys ), binding.KeyName, true ); MonitorState = binding.KeyState; }