public override bool OnMessage(Message message) { if(message.Id == UpdateMessage.MessageId) { return OnUpdate(message as UpdateMessage); } else { return base.OnMessage(message); } }
public override bool OnMessage(Message message) { if (message.Id == DrawMessage.MessageId) { return OnDrawMessage(message as DrawMessage); } else if (message.Id == UICommandMessage.MessageId) { return OnUICommandMessage(message as UICommandMessage); } else { return false; } }
public override bool OnMessage(Message message) { if(message== null) { throw new ArgumentNullException("message"); } if(message.Id == DrawMessage.MessageId) { return OnDrawMessage(message as DrawMessage); } else { return false; } }
public abstract bool OnMessage(Message message);
public void Notify(Message message,bool reverse=false) { if(Disabled) { return; } if(!reverse) { OnMessage(message); } for (int index = 0; index < _children.Count(); ++index) { _children[reverse ? _children.Count()-index : index].Notify(message, reverse); } if(reverse) { OnMessage(message); } }
public bool HandleNotify(Message message, bool reverse=true) { if (Disabled) { return false; } if (!reverse) { if(OnMessage(message)) { return true; } } for (int index = 0; index < _children.Count(); ++index) { if(_children[reverse ? _children.Count() - index -1 : index].HandleNotify(message, reverse)) { return true; } } if (reverse) { return OnMessage(message); } return false; }
public bool HandleMessage(Message message) { if(Disabled) { return false; } else if(OnMessage(message)) { return true; } else if(HasParent) { return Parent.HandleMessage(message); } else { return false; } }
public override bool OnMessage(Message message) { if(message== null) { throw new ArgumentNullException("message"); } if(_handlers.ContainsKey(message.Id)) { return _handlers[message.Id](message); } else { Debug.Print("Message Id: {0}", message.Id); return false; } }
public bool DispatchInput(Message message) { if (InputFocus == null || InputFocus.Disabled) { return HandleNotify(message); } else { return InputFocus.OnMessage(message); } }