/// <summary>
		/// Called when [mouse pressed].
		/// </summary>
		/// <param name="e">The e.</param>
		/// <param name="button">The button.</param>
		/// <returns></returns>
		private bool OnMousePressed(MouseEventDescriptor e, MouseButton button)
		{
			var @event = new MouseEventArgs(e);
			bool result = true;

			if (MousePressed != null)
			{
				foreach (MouseClickHandler @delegate in MousePressed.GetInvocationList())
				{
					result = result && @delegate(@event, button);
				}
			}

			foreach (IMouseListener mouseListener in _listeners)
			{
				result = result && mouseListener.OnMousePressed(@event, button);
			}

			return result;
		}
Exemple #2
0
		/// <summary>
		/// Initializes the specified descriptor.
		/// </summary>
		/// <param name="descriptor">The descriptor.</param>
		protected void Initialize(MouseEventDescriptor descriptor)
		{
			Initialize(descriptor.Base);
			State = new MouseState(descriptor.MouseState);
		}
Exemple #3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="MouseEventArgs"/> class.
		/// </summary>
		/// <param name="descriptor">The mouse event descriptor.</param>
		protected internal MouseEventArgs(MouseEventDescriptor descriptor)
			: base(descriptor.Base, CreateCppInstance<IMouseEvent>())
		{
			Initialize(descriptor);
		}