UMD.HCIL.Piccolo.Event.PInputEventArgs.DispatchTo C# (CSharp) Method

DispatchTo() public method

Raises the appropriate event on the given node.
public DispatchTo ( object sender ) : void
sender object The node for which the event will be raised.
return void
		public virtual void DispatchTo(object sender) {
			switch (type) {
				case PInputType.KeyDown:
					((PNode)sender).OnKeyDown(this);
					break;

				case PInputType.KeyPress:
					((PNode)sender).OnKeyPress(this);
					break;

				case PInputType.KeyUp:
					((PNode)sender).OnKeyUp(this);
					break;

				case PInputType.Click:
					((PNode)sender).OnClick(this);
					break;

				case PInputType.DoubleClick:
					((PNode)sender).OnDoubleClick(this);
					break;

				case PInputType.MouseDown:
					((PNode)sender).OnMouseDown(this);
					break;

				case PInputType.MouseDrag:
					((PNode)sender).OnMouseDrag(this);
					break;

				case PInputType.MouseUp:
					((PNode)sender).OnMouseUp(this);
					break;

				case PInputType.MouseMove:
					((PNode)sender).OnMouseMove(this);
					break;

				case PInputType.MouseEnter:
					((PNode)sender).OnMouseEnter(this);
					break;

				case PInputType.MouseLeave:
					((PNode)sender).OnMouseLeave(this);
					break;

				case PInputType.MouseWheel:
					((PNode)sender).OnMouseWheel(this);
					break;

				case PInputType.DragEnter:
					((PNode)sender).OnDragEnter(this);
					break;

				case PInputType.DragLeave:
					((PNode)sender).OnDragLeave(this);
					break;

				case PInputType.DragOver:
					((PNode)sender).OnDragOver(this);
					break;

				case PInputType.DragDrop:
					((PNode)sender).OnDragDrop(this);
					break;

				case PInputType.GotFocus:
					((PNode)sender).OnGotFocus(this);
					break;

				case PInputType.LostFocus:
					((PNode)sender).OnLostFocus(this);
					break;
			}
		}
		#endregion

Usage Example

Beispiel #1
0
		//****************************************************************
		// Process Events - Methods for handling events dispatched to the
		// pick path.
		//****************************************************************

		/// <summary>
		/// Gives each node in the pick path, starting with the bottom-most one, a chance to
		/// handle the event.
		/// </summary>
		/// <param name="e">A PInputEventArgs that contains the event data.</param>
		public virtual void ProcessEvent(PInputEventArgs e) {
			e.Path = this;
		
			object[] pushedNodes = nodeStack.ToArray();
			for (int i = 0; i < pushedNodes.Length; i++) {
				PNode each = (PNode) pushedNodes[i];
				EventHandlerList handlers = each.HandlerList;

				if (handlers != null) e.DispatchTo(each);
			}	
		}