本文整理汇总了C++中EventHandler::Invoke方法的典型用法代码示例。如果您正苦于以下问题:C++ EventHandler::Invoke方法的具体用法?C++ EventHandler::Invoke怎么用?C++ EventHandler::Invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventHandler
的用法示例。
在下文中一共展示了EventHandler::Invoke方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LocalFilterFunc
//*************************************************************************
// Method: LocalFilterFunc
// Description: handles the filter event
//
// Parameters:
// sender - the sender of the event
// e - the args representing the event
//
// Return Value: None
//*************************************************************************
void FilterListView::LocalFilterFunc(Object *sender, EventArgs *e)
{
if (customFilters->Item[columnWithFocus])
{
EventHandler *customFilterMethod = static_cast<EventHandler *>(customFilters->Item[columnWithFocus]);
customFilterMethod->Invoke(sender, EventArgs->Empty);
}
}
示例2: localFilterFunc
//*************************************************************************
// Method: localFilterFunc
// Description: The local function which is called when "Custom Filter .."
// is selected. This method calls the appropriate handler
// function (if exists) by looking it up in the hash table.
//
// Parameters:
// sender - the object which sent this
// e - the event arguments
//
// Return Value: None
//*************************************************************************
void FilterListView::localFilterFunc(System::Object * sender, EventArgs * e)
{
if (customFilters->Item[columnWithFocus] != NULL)
{
//checkItemRadio (static_cast <MenuItem *> (sender));
EventHandler * customFilterMethod = static_cast <EventHandler *> (customFilters->Item[columnWithFocus]);
customFilterMethod->Invoke (sender, EventArgs->Empty);
}
}
示例3: OnEvent
void Object::OnEvent(Object* sender, StringHash eventType, VariantMap& eventData)
{
// Make a copy of the context pointer in case the object is destroyed during event handler invocation
Context* context = context_;
EventHandler* specific = 0;
EventHandler* nonSpecific = 0;
EventHandler* handler = eventHandlers_.First();
while (handler)
{
if (handler->GetEventType() == eventType)
{
if (!handler->GetSender())
nonSpecific = handler;
else if (handler->GetSender() == sender)
{
specific = handler;
break;
}
}
handler = eventHandlers_.Next(handler);
}
// Specific event handlers have priority, so if found, invoke first
if (specific)
{
context->SetEventHandler(specific);
specific->Invoke(eventData);
context->SetEventHandler(0);
return;
}
if (nonSpecific)
{
context->SetEventHandler(nonSpecific);
nonSpecific->Invoke(eventData);
context->SetEventHandler(0);
}
}