コード例 #1
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);
 }
コード例 #2
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));
 }
コード例 #3
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]);
 }
コード例 #4
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]);
 }