Exemplo n.º 1
0
		/// <summary>
		/// Initializes the specified descriptor.
		/// </summary>
		/// <param name="descriptor">The descriptor.</param>
		protected void Initialize(KeyEventDescriptor descriptor)
		{
			Initialize(descriptor.Base);

			_key = descriptor.Key;
			_text = descriptor.Text;
		}
Exemplo n.º 2
0
		/// <summary>
		/// Called when [key pressed].
		/// </summary>
		/// <param name="e">The e.</param>
		/// <returns></returns>
		private bool OnKeyPressed(KeyEventDescriptor e)
		{
			bool result = true;
			var keyEvent = new KeyEventArgs(e);

			if (KeyPressed != null)
			{
				foreach (KeyEventHandler @delegate in KeyPressed.GetInvocationList())
				{
					result = result && @delegate(keyEvent);
				}
			}

			foreach (IKeyListener keyListener in Listeners)
			{
				result = result && keyListener.OnKeyPressed(keyEvent);
			}

			return result;
		}
Exemplo n.º 3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="KeyEventArgs"/> class.
		/// </summary>
		/// <param name="descriptor">The key event extended.</param>
		internal KeyEventArgs(KeyEventDescriptor descriptor)
			: base(descriptor.Base, CreateCppInstance<IKeyEvent>())
		{
			Initialize(descriptor);
		}