Beispiel #1
0
 /// <summary>
 /// Remove a Core.
 /// </summary>
 /// <remarks>
 ///     <para>
 ///         Remove the Model, View, Controller and Facade
 ///         instances for the given key.
 ///     </para>
 /// </remarks>
 /// <param name="key">multitonKey of the Core to remove</param>
 public static void RemoveCore(string key)
 {
     if (InstanceMap.TryGetValue(key, out _) == false)
     {
         return;
     }
     Model.RemoveModel(key);
     View.RemoveView(key);
     Controller.RemoveController(key);
     InstanceMap.TryRemove(key, out _);
 }
Beispiel #2
0
 public InstanceInfo GetInstance(string instanceId)
 {
     InstanceMap.TryGetValue(instanceId, out var result);
     return(result);
 }
Beispiel #3
0
 /// <summary>
 ///  Check if a Core is registered or not
 /// </summary>
 /// <param name="key">the multiton key for the Core in question</param>
 /// <returns>whether a Core is registered with the given <c>key</c>.</returns>
 public static bool HasCore(string key)
 {
     return(InstanceMap.TryGetValue(key, out _));
 }