Inheritance: TriggerManager
 public WaitForPaymentProcessingAttribute(TriggerEvents on = TriggerEvents.Init)
     : base(WaitBy.Class, "loader", Until.VisibleThenMissingOrHidden, on)
 {
     PresenceTimeout        = 5;
     ThrowOnPresenceFailure = false;
     AbsenceTimeout         = 30;
 }
        /// <summary>
        /// Populates the rule based on an XML representation of the object
        /// </summary>
        /// <param name="node">The XmlNode representation of the object</param>
        protected override void FromXml(XmlNode node)
        {
            base.FromXml(node);

            XmlAttribute attributeNameAttribute = node.Attributes["attribute"];
            XmlAttribute triggerAttribute       = node.Attributes["triggers"];

            if (attributeNameAttribute == null || triggerAttribute == null)
            {
                throw new ArgumentException("The attribute name and trigger must be specified");
            }

            MASchema.ThrowOnMissingAttribute(attributeNameAttribute.Value);
            this.AttributeName = attributeNameAttribute.Value;

            TriggerEvents events;

            if (Enum.TryParse(triggerAttribute.Value, true, out events))
            {
                this.TriggerEvents = events;
            }
            else
            {
                throw new ArgumentException("The trigger value is unknown or unsupported");
            }
        }
 public WaitForLoadingIndicatorAttribute(TriggerEvents on = TriggerEvents.Init)
     : base(WaitBy.Class, "px-loader-circle", Until.VisibleThenMissingOrHidden, on)
 {
     PresenceTimeout        = 3;
     ThrowOnPresenceFailure = false;
     AbsenceTimeout         = 20;
 }
Exemplo n.º 4
0
 public IntrospectedTrigger(string schema, string name, IntrospectedTable table, TriggerTiming timing, TriggerEvents events, string body)
     : base(schema, name)
 {
     this.table  = table;
     this.timing = timing;
     this.events = events;
     this.body   = body;
 }
Exemplo n.º 5
0
        protected override void InitComponent()
        {
            base.InitComponent();

            TriggerEvents allEvents = typeof(TriggerEvents).GetIndividualEnumFlags().Cast <TriggerEvents>().Aggregate((a, b) => a | b);

            Input.Triggers.Add(new WriteTriggerEventAttribute(allEvents));
        }
Exemplo n.º 6
0
        protected override void OnInit()
        {
            Metadata.Add(new LogInfoAttribute("Init-Lower", TriggerEvents.Init, TriggerPriority.Lower));

            TriggerEvents allEvents = typeof(TriggerEvents).GetIndividualEnumFlags().Cast <TriggerEvents>().Aggregate((a, b) => a | b);

            Input.Metadata.Add(new WriteTriggerEventAttribute(allEvents));
        }
Exemplo n.º 7
0
    public void Fall(TriggerEvents e = null)
    {
        if (e != null)
        {
            events += e;
        }

        gameObject.GetComponent <Animator>().SetBool("Falling", true);
    }
Exemplo n.º 8
0
        internal void Execute(TriggerEvents on)
        {
            if (on == TriggerEvents.None || currentDeniedTriggers.Contains(on))
            {
                return;
            }

            if (orderedTriggers?.Length > 0)
            {
                if (DenyTriggersMap.Values.TryGetValue(on, out TriggerEvents[] denyTriggers))
Exemplo n.º 9
0
            public EventTrigger(TWS script, string name, string label, TriggerEvents eventtype)
            {
                Script = script;
                Name   = name;
                Label  = label;

                this.type      = TriggerType.Event;
                this.priority  = TriggerPriorityType.Normal;
                this.eventtype = eventtype;
            }
Exemplo n.º 10
0
 private void ExecuteForChildren(TriggerEvents on)
 {
     if (on == TriggerEvents.Init || on == TriggerEvents.DeInit)
     {
         foreach (UIComponent <TOwner> child in component.Controls)
         {
             child.Triggers.Execute(on);
         }
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WaitForElementAttribute" /> class.
 /// </summary>
 /// <param name="waitBy">The kind of the element selector to wait for.</param>
 /// <param name="selector">The selector.</param>
 /// <param name="until">The waiting condition.</param>
 /// <param name="on">The trigger events.</param>
 /// <param name="priority">The priority.</param>
 public WaitForElementAttribute(
     WaitBy waitBy,
     string selector,
     Until until              = Until.MissingOrHidden,
     TriggerEvents on         = TriggerEvents.AfterClick,
     TriggerPriority priority = TriggerPriority.Medium)
     : base(until, on, priority)
 {
     WaitBy   = waitBy;
     Selector = selector;
 }
Exemplo n.º 12
0
        public WaitForLoadingIndicatorAttribute(TriggerEvents on = TriggerEvents.Init)
            : base(WaitBy.Class, "overlay", Until.VisibleThenMissingOrHidden, on)
        {
            // On some pages with quick loading the indicator can even not appear.
            // For such case we can decrease the time of element presence and declare that timeout exception should not be thrown.
            // Meaning if within 2 seconds the element will not appear then OK, continue the execution.
            // Note that this settings can differ depending on specific indicator behavior.
            PresenceTimeout        = 2;     // Sets max waiting time in seconds for the presence of an element.
            ThrowOnPresenceFailure = false; // Do not throw exception if indicator is not found.

            AbsenceTimeout = 10;            // Sets max waiting time in seconds for the absence of an element.
        }
Exemplo n.º 13
0
        internal void Execute(TriggerEvents on)
        {
            if (on == TriggerEvents.None || currentDeniedTriggers.Contains(on))
            {
                return;
            }

            var orderedTriggers = AllTriggers;

            if (orderedTriggers.Any())
            {
                if (DenyTriggersMap.Values.TryGetValue(on, out TriggerEvents[] denyTriggers))
Exemplo n.º 14
0
        public static void ProcessEvent(TriggerEvents eventtype)
        {
            var events = eventtriggers.Where(e => e.eventtype == eventtype);

            if (events.Count() > 0)
            {
                foreach (EventTrigger e in events)
                {
                    e.Script.Exec(e.Label);
                }
            }
        }
Exemplo n.º 15
0
    public void FadeIn(TriggerEvents e)
    {
        state = CutSceneState.STARTS_FADING_IN;

        gameObject.GetComponent <Animator> ().enabled = true;
        gameObject.GetComponent <Animator>().SetBool("StartFadingIn", true);

        if (e != null)
        {
            events += e;
        }
    }
Exemplo n.º 16
0
    protected override IEnumerable <Command> OnCreate(IMetadata sourceMetadata, IMetadata targetMetadata, IComparerContext context)
    {
        var command = SqlHelper.IsValidExternalEngine(this) ? new Command() : new PSqlCommand();

        command
        .Append($"CREATE OR ALTER TRIGGER {TriggerName.AsSqlIndentifier()}")
        .AppendLine()
        .Append($"{(Inactive ? "INACTIVE" : "ACTIVE")} ");
        switch (TriggerClass)
        {
        case TriggerClassType.DML:
        case TriggerClassType.DDL:
            command.Append($"{TriggerBeforeAfter.ToDescription()} {TriggerEvents[0].ToDescription()} ");
            foreach (var item in TriggerEvents.Skip(1))
            {
                command.Append($"OR {item.ToDescription()} ");
            }
            break;

        case TriggerClassType.DB:
            command.Append($"ON {TriggerEvents[0].ToDescription()} ");
            break;
        }
        command
        .Append($"POSITION {TriggerSequence}")
        .AppendLine();
        if (TriggerClass == TriggerClassType.DML)
        {
            command
            .Append($"ON {RelationName.AsSqlIndentifier()}")
            .AppendLine();
        }
        if (SqlHelper.IsValidExternalEngine(this))
        {
            command.Append($"EXTERNAL NAME '{SqlHelper.DoubleSingleQuotes(EntryPoint)}'");
            command.AppendLine();
            command.Append($"ENGINE {EngineName.AsSqlIndentifier()}");
        }
        else
        {
            if (SqlSecurity != null)
            {
                command.Append($"SQL SECURITY {SqlHelper.SqlSecurityString(SqlSecurity)}");
                command.AppendLine();
            }
            command.Append(TriggerSource);
        }
        yield return(command);
    }
Exemplo n.º 17
0
 private static IEnumerable <string> eachEvent(TriggerEvents events)
 {
     if (events.HasFlag(TriggerEvents.Insert))
     {
         yield return("INSERT");
     }
     if (events.HasFlag(TriggerEvents.Update))
     {
         yield return("UPDATE");
     }
     if (events.HasFlag(TriggerEvents.Delete))
     {
         yield return("DELETE");
     }
 }
Exemplo n.º 18
0
        internal void Execute(TriggerEvents on)
        {
            if (orderedTriggers == null || orderedTriggers.Length == 0 || on == TriggerEvents.None || currentDeniedTriggers.Contains(on))
            {
                return;
            }

            TriggerEvents[] denyTriggers;
            if (DenyTriggersMap.TryGetValue(on, out denyTriggers))
            {
                currentDeniedTriggers.AddRange(denyTriggers);
            }

            try
            {
                var triggers = orderedTriggers.Where(x => x.On.HasFlag(on));

                TriggerContext <TOwner> context = new TriggerContext <TOwner>
                {
                    Event     = on,
                    Driver    = component.Driver,
                    Log       = component.Log,
                    Component = component
                };

                foreach (var trigger in triggers)
                {
                    trigger.Execute(context);
                }
            }
            finally
            {
                if (denyTriggers != null)
                {
                    currentDeniedTriggers.RemoveAll(x => denyTriggers.Contains(x));
                }
            }

            if (on == TriggerEvents.Init || on == TriggerEvents.DeInit)
            {
                foreach (UIComponent <TOwner> child in component.Controls)
                {
                    child.Triggers.Execute(on);
                }
            }
        }
Exemplo n.º 19
0
    public bool AddAvatarPedestalsToTrigger(GameObject MyObjectWithTrigger, List <GameObject> MyAvatarPedestals)
    {
        VRC_Trigger MyTriggerScript;
        List <VRC_Trigger.TriggerEvent> TriggerEvents;

        VRC_Trigger.TriggerEvent         MyTriggerEvent;
        List <VRC_EventHandler.VrcEvent> MyEvents;

        VRC_EventHandler.VrcEvent MyEvent;

        if (MyObjectWithTrigger == null)
        {
            CustomMessage = "Select Objects With Trigger If You Want To Toggle Avatar Pedestals By Pressing Button";
            return(false);
        }

        MyTriggerScript = MyObjectWithTrigger.GetComponent <VRC_Trigger>();

        if (MyTriggerScript == null)
        {
            CustomMessage = "Object Does Not Contain A Trigger";
            return(false);
        }

        MyTriggerScript.interactText = "Avatars";
        TriggerEvents              = MyTriggerScript.Triggers;
        MyTriggerEvent             = new VRC_Trigger.TriggerEvent();
        MyTriggerEvent.TriggerType = VRC_Trigger.TriggerType.OnInteract;

        if (bLocalActivateByTrigger)
        {
            MyTriggerEvent.BroadcastType = VRC_EventHandler.VrcBroadcastType.Local;
        }

        MyEvents                 = MyTriggerEvent.Events;
        MyEvent                  = new VRC_EventHandler.VrcEvent();
        MyEvent.EventType        = VRC_EventHandler.VrcEventType.SetGameObjectActive;
        MyEvent.ParameterObjects = MyAvatarPedestals.ToArray();
        MyEvent.ParameterBoolOp  = VRC_EventHandler.VrcBooleanOp.Toggle;
        MyEvents.Add(MyEvent);
        TriggerEvents.Add(MyTriggerEvent);
        return(true);
    }
Exemplo n.º 20
0
        public void TriggerParticle()
        {
            if (SubStates == null)
            {
                return;
            }
            if (EnableEventReceiver == false)
            {
                if (CanTriggerParticle() == false)
                {
                    return;
                }

                FireParticles();
            }


            //待触发特效
            if (TriggerEvents.Count == 0)
            {
                return;
            }

            for (int i = TriggerEvents.Count - 1; i >= 0; i--)
            {
                var te = TriggerEvents[i];
                TriggeringEvent = te;


                if (te.CanTriggerParticle(this))
                {
                    te.ResetPreTriggerTick();
                    FireParticles();
                }

                TriggeringEvent = null;

                if (te.IsDeath(this))
                {
                    TriggerEvents.RemoveAt(i);
                }
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// Populates the RuleSet object from an XML representation
        /// </summary>
        /// <param name="node">The XML representation of the object</param>
        protected override void FromXml(XmlNode node)
        {
            base.FromXml(node);

            TriggerEvents events           = 0;
            XmlAttribute  triggerAttribute = node.Attributes["triggers"];

            if (triggerAttribute == null)
            {
                throw new ArgumentException("A triggers value must be specified");
            }

            if (Enum.TryParse(triggerAttribute.Value, true, out events))
            {
                this.TriggerEvents = events;
            }
            else
            {
                throw new ArgumentException("The trigger value is unknown or unsupported");
            }
        }
Exemplo n.º 22
0
            public EventTrigger(TWS script, string name, string label, string eventname)
            {
                Script = script;
                Name   = name;
                Label  = label;

                this.type     = TriggerType.Event;
                this.priority = TriggerPriorityType.Normal;

                switch (eventname.ToUpper())
                {
                case "CONNECTION ACCEPTED":
                    eventtype = TriggerEvents.Connect;
                    break;

                case "CONNECTION LOST":
                    eventtype = TriggerEvents.Disconnect;
                    break;

                default:
                    break;
                }
            }
Exemplo n.º 23
0
 public PressEnterAttribute(TriggerEvents on = TriggerEvents.AfterSet, TriggerPriority priority = TriggerPriority.Medium)
     : base(OpenQA.Selenium.Keys.Enter, on, priority)
 {
 }
Exemplo n.º 24
0
 protected TriggerAttribute(TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium)
 {
     On       = on;
     Priority = priority;
 }
Exemplo n.º 25
0
 public CustomWaitForScriptAttribute(string expectedValue, TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium)
     : base(on, priority)
 {
     ExpectedValue = expectedValue;
 }
Exemplo n.º 26
0
 public CloseConfirmBoxAttribute(bool accept = true, TriggerEvents on = TriggerEvents.AfterClick, TriggerPriority priority = TriggerPriority.Medium)
     : base(on, priority)
 {
     Accept = accept;
 }
Exemplo n.º 27
0
 public InvokeDelegateAttribute(Action actionDelegate, TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium)
     : base(on, priority)
 {
     ActionDelegate = actionDelegate.CheckNotNull(nameof(actionDelegate));
 }
Exemplo n.º 28
0
 protected WaitForAttribute(WaitUntil until, TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium)
     : base(on, priority)
 {
     Until = until;
 }
Exemplo n.º 29
0
 public PressTabAttribute(TriggerEvents on = TriggerEvents.AfterSet, TriggerPriority priority = TriggerPriority.Medium)
     : base(OpenQA.Selenium.Keys.Tab, on, priority)
 {
 }
Exemplo n.º 30
0
 protected WaitForAttribute(WaitUntil until, TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium)
     : base(on, priority)
 {
     Until = until;
 }
Exemplo n.º 31
0
 protected void ExecuteTriggers(TriggerEvents on)
 {
     Triggers.Execute(on);
 }
 public WaitForAngularJSAjaxAttribute(TriggerEvents on = TriggerEvents.AfterClick, TriggerPriority priority = TriggerPriority.Medium)
     : base(on, priority)
 {
 }