public Locator( ImMap <string, ImMap <string, LocatorTarget> > registrationList, ImList <LocatorPlug> plugs ) { RegistrationList = registrationList; Plugs = plugs; }
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); }
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)); }
public PlugState( string domain, string address, ImMap <string, ImMap <string, LocatorTarget> > registrationList ) { Domain = domain; Address = address; RegistrationList = registrationList; }
private ImMap <string, LocatorTarget> GetTargetList( string domain, ImMap <string, ImMap <string, LocatorTarget> > registrationList ) { if (!registrationList.Has(domain)) { return(Im.Map <LocatorTarget>()); } return(RegistrationList[domain]); }
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]); }
public static void Maybe <V>(Action <V, string> action, string key, ImMap <string, V> map) { Maybe <string, V>(action, key, map); }
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)); }