当前位置: 首页>>代码示例>>C++>>正文


C++ EventHandler::Invoke方法代码示例

本文整理汇总了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);
		}
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:18,代码来源:FilterListView.cpp

示例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);
		}
	}
开发者ID:IFGHou,项目名称:Holodeck,代码行数:21,代码来源:FilterListView.cpp

示例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);
    }
}
开发者ID:RobertoMalatesta,项目名称:AtomicGameEngine,代码行数:39,代码来源:Object.cpp


注:本文中的EventHandler::Invoke方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。