예제 #1
0
SystemTray::Handle SystemTray::Add(RF_Mem::AutoPointer<TrayIcon>& NewTrayIcon)
{
    auto iconHandle = m_PImpl->m_Backend->AddIcon(*NewTrayIcon.Get());
    m_PImpl->m_Lookup[iconHandle] = NewTrayIcon.Get();
    m_PImpl->m_Icons.PushBack(NewTrayIcon);
    return iconHandle;
}
void Collector::RegisterComponentManager(RF_Mem::AutoPointer<BaseComponentProcessor>& ComponentManager)
{
    // check if one of the components is already known
    for(RF_Type::Size i = 0; i < ComponentManager->ComponentTypes().Count(); ++i)
    {
        if(m_ComponentManagerLookup.ContainsKey(ComponentManager->ComponentTypes()(i)))
        {
            RF_IO::LogDebug("The component %d is already registered!\n", ComponentManager->ComponentTypes()(i));
            return;
        }
    }

    // register all new components
    for(RF_Type::Size i = 0; i < ComponentManager->ComponentTypes().Count(); ++i)
    {
        m_ComponentManagerLookup[ComponentManager->ComponentTypes()(i)] = ComponentManager.Get();
    }    

    ComponentManager->Setup(*m_Allocator, m_Attributes);
    m_ComponentManagers.Resize(m_ComponentManagers.Count()+1);
    m_ComponentManagers(m_ComponentManagers.Count()-1)=ComponentManager;
}