Example #1
0
        public void OnManagerRegistered(IManager manager)
        {
            Type type = manager.GetType();

            if (targetManagers.Contains(type))          // Ensure the given manager is of a type required by the search
            {
                if (!currentManagers.Contains(manager)) // Check if the manager isn't currently contained
                {
                    currentManagers.Add(manager);
                    CheckStatus();
                }
            }
        }
 /// <summary>
 /// Add a manager to the system.
 /// </summary>
 /// <param name="manager"></param>
 /// <returns> Whether the manager was added. </returns>
 public bool Add(IManager manager)
 {
     if (manager != null)           // Entry is not null
     {
         if (managers.Add(manager)) // Was addition successful?
         {
             manager.OnManagerRegistered(this);
             NotifyManagerAdded(manager);
             return(true);
         }
         else // Manager wasn't added
         {
             return(false);
         }
     }
     else // Null entry
     {
         return(false);
     }
 }
Example #3
0
        public bool AddTarget <T>() where T : IManager
        {
            Type type = typeof(T);

            return(targetManagers.Add(type));
        }
Example #4
0
 public bool AddListener(ISyncListener listener)
 {
     return(listeners.Add(listener));
 }
 /// <summary>
 /// Add the given listener.
 /// </summary>
 /// <param name="listener"></param>
 /// <returns> Whether the listener was added. </returns>
 public bool AddListener(IManagementListener listener)
 {
     return(listeners.Add(listener));
 }