Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
        }