コード例 #1
0
 private static Trigger CreateTrigger(XElement triggerXml)
 {
     var trigger = new Trigger();
     trigger.Description = GetAttribute(triggerXml.Attribute("description"));
     trigger.Id = GetAttribute(triggerXml.Attribute("id"));
     trigger.StartConditions.AddRange(CreateConditions(triggerXml, "startConditions"));
     trigger.EndConditions.AddRange(CreateConditions(triggerXml, "endConditions"));
     trigger.Sources.AddRange(CreateSources(triggerXml, "sources"));
     return trigger;
 }
コード例 #2
0
        //private bool spent = false;

        internal TriggerManager(Trigger trigger, IMastAdapter mastInterface)
        {
            if (trigger == null)
            {
                throw new NullReferenceException("Trigger must not be null.");
            }
            if (mastInterface == null)
            {
                throw new NullReferenceException("IMastAdapter must not be null.");
            }

            Trigger = trigger;
            MastInterface = mastInterface;

            foreach (Condition c in trigger.StartConditions)
            {
                ConditionManager cm = new ConditionManager(c, MastInterface);
                //We need to wire up events, for event type conditions, and this is also used for some property calculations around time
                //if (c.type == ConditionType.@event) {
                cm.EventFired += OnConditionEventFired;
                //}
                StartConditions.Add(cm);
            }

            foreach (Condition c in trigger.EndConditions)
            {
                ConditionManager cm = new ConditionManager(c, MastInterface) { IsEndCondition = true };
                //if (c.type == ConditionType.@event) {
                cm.EventFired += OnConditionEventFired;
                //}
                EndConditions.Add(cm);
            }

            //we just need this for 'per clip' events, to reset the flag
            //ReflectionHelper.AttachEvent(MastInterface, "OnItemEnd", this, "OnItemEnd");
        }
コード例 #3
0
 internal TriggerFailureEventArgs(Trigger trigger, Exception exception)
 {
     Exception = exception;
     Trigger = trigger;
 }
コード例 #4
0
 internal TriggerEventArgs(Trigger trigger)
 {
     Trigger = trigger;
 }