Ejemplo n.º 1
0
        private EventState EventStateContainerAdd(EventStateContainer states, Cdn.Node cont, string state)
        {
            if (String.IsNullOrEmpty(state))
            {
                return(null);
            }

            if (!states.States.Contains(state))
            {
                states.States.Add(state);

                var evs = new EventState {
                    Node          = cont,
                    Name          = state,
                    ActiveActions = new List <Cdn.EdgeAction>(),
                    Index         = d_eventStates.Count,
                };

                d_eventStates.Add(evs);
                d_eventStateIdMap[EventStateId(evs.Node, evs.Name)] = evs;
                return(evs);
            }
            else
            {
                return(d_eventStateIdMap[EventStateId(cont, state)]);
            }
        }
Ejemplo n.º 2
0
        private EventStateContainer AddEventStateContainer(Cdn.Node node)
        {
            EventStateContainer states;

            if (!d_eventStatesMap.TryGetValue(node, out states))
            {
                states = new EventStateContainer {
                    States = new List <string>(),
                    Index  = d_eventStatesMap.Count,
                };

                d_eventStatesMap[node] = states;
            }

            return(states);
        }