Ejemplo n.º 1
0
 public Locator(
     ImMap <string, ImMap <string, LocatorTarget> > registrationList,
     ImList <LocatorPlug> plugs
     )
 {
     RegistrationList = registrationList;
     Plugs            = plugs;
 }
Ejemplo n.º 2
0
 public static void Maybe <K, V>(Action <V, K> action, K key, ImMap <K, V> map)
 {
     if (!map.Has(key))
     {
         return;
     }
     action(map[key], key);
 }
Ejemplo n.º 3
0
 public static T Maybe <K, V, T>(Func <V, K, T> action, K key, ImMap <K, V> map)
 {
     if (!map.Has(key))
     {
         return(default(T));
     }
     return(action(map[key], key));
 }
Ejemplo n.º 4
0
 public PlugState(
     string domain,
     string address,
     ImMap <string, ImMap <string, LocatorTarget> > registrationList
     )
 {
     Domain           = domain;
     Address          = address;
     RegistrationList = registrationList;
 }
Ejemplo n.º 5
0
 private ImMap <string, LocatorTarget> GetTargetList(
     string domain,
     ImMap <string, ImMap <string, LocatorTarget> > registrationList
     )
 {
     if (!registrationList.Has(domain))
     {
         return(Im.Map <LocatorTarget>());
     }
     return(RegistrationList[domain]);
 }
Ejemplo n.º 6
0
 private LocatorTarget GetTargetFromTargetList(
     string address,
     ImMap <string, LocatorTarget> targetList
     )
 {
     if (!targetList.Has(address))
     {
         // MEMO: do error handling inside a plug
         return(new LocatorTarget());
     }
     return(targetList[address]);
 }
Ejemplo n.º 7
0
 public static void Maybe <V>(Action <V, string> action, string key, ImMap <string, V> map)
 {
     Maybe <string, V>(action, key, map);
 }
Ejemplo n.º 8
0
 public static T Maybe <V, T>(Func <V, string, T> action, string key, ImMap <string, V> map)
 {
     return(Maybe <string, V, T>(action, key, map));
 }