本文整理汇总了C++中UIControl::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ UIControl::Release方法的具体用法?C++ UIControl::Release怎么用?C++ UIControl::Release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIControl
的用法示例。
在下文中一共展示了UIControl::Release方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMetadataForTreeNodesList
BaseMetadata* MetadataFactory::GetMetadataForTreeNodesList(const HierarchyTreeController::SELECTEDCONTROLNODES& nodesList) const
{
if (nodesList.empty())
{
Logger::Error("MetadataFactory::GetMetadataForTreeNodesList - Nodes List is empty!");
return NULL;
}
// Simplified logic for now. If all the UI Controls attached to the node have the same type, return it.
// Otherwise return common UIControlMetadata.
bool allNodesHaveSameUIObjectType = true;
const char* firstUIControlType = NULL;
for (HierarchyTreeController::SELECTEDCONTROLNODES::const_iterator iter = nodesList.begin();
iter != nodesList.end(); iter ++)
{
UIControl* attachedControl = (*iter)->GetUIObject();
if (firstUIControlType == NULL)
{
// Remember the first node type.
firstUIControlType = typeid(*attachedControl).name();
continue;
}
// Compare the current control type with the first one.
if (strcmp(firstUIControlType, typeid(*attachedControl).name()) != 0)
{
allNodesHaveSameUIObjectType = false;
break;
}
}
if (allNodesHaveSameUIObjectType)
{
// Since all the nodes have the same UI Object type attached, use the first one.
return GetMetadataForUIControl((*nodesList.begin())->GetUIObject());
}
else
{
// Return the metadata for common UIControl.
UIControl* uiControl = new UIControl();
BaseMetadata* resultMetadata = GetMetadataForUIControl(uiControl);
uiControl->Release();
return resultMetadata;
}
}