public static void MergeRoutes(Dictionary <string, Route> newRouteDictionary)
 {
     if ((newRouteDictionary != null) && (newRouteDictionary.Count > 0))
     {
         foreach (var item in newRouteDictionary)
         {
             IoC.RegisterInstance(typeof(Route), item.Key, item.Value);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Merge routes.
 /// </summary>
 /// <param name="newCommandDictionary">
 /// The new command dictionary.
 /// </param>
 public static void MergeCommands(Dictionary <string, Command> newCommandDictionary)
 {
     if (newCommandDictionary != null && newCommandDictionary.Any())
     {
         foreach (var item in newCommandDictionary)
         {
             IoC.RegisterInstance(typeof(Command), item.Key, item.Value);
         }
     }
 }
 public static void AddRoute(string key, Route route)
 {
     IoC.RegisterInstance(typeof(Route), key, route);
 }
Exemple #4
0
 /// <summary>
 /// Adds command.
 /// </summary>
 /// <param name="key">
 /// The key.
 /// </param>
 /// <param name="command">
 /// The command.
 /// </param>
 public static void AddCommand(string key, Command command)
 {
     IoC.RegisterInstance(typeof(Command), key, command);
 }