public void AddIntoGroup(ScopeGroup group, ScopeComponent component, ARScopeEntry entry) { var elem = this.AddAction(component, entry); if (!Groups.ContainsKey(group)) { Groups.Add(group, new Dictionary <ScopeComponent, ARScopeEntry>()); } if (!Groups[group].ContainsKey(component)) { Groups[group].Add(elem.Key, elem.Value); } }
public void ScopeWith(ARScope scope, ARScope.ScopeGroup?group, ARScope.ScopeComponent component, Action <dynamic>?action = null) { ARScopeEntry entry = new ARScopeEntry(); entry.Inline = () => { InvokeAsync(() => { this.StateHasChanged(); }); }; entry.Override = action; if (group.HasValue) { scope.AddIntoGroup(group.Value, component, entry); } else { scope.AddAction(component, entry); } }
public KeyValuePair <ScopeComponent, ARScopeEntry> AddAction(ScopeComponent id, ARScopeEntry entry) { KeyValuePair <ScopeComponent, ARScopeEntry> pair = KeyValuePair.Create <ScopeComponent, ARScopeEntry>(id, entry); if (this.Actions.ContainsKey(id)) { return(pair); } this.Actions.Add(pair.Key, pair.Value); return(pair); }