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; }
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; }
protected override void InitComponent() { base.InitComponent(); TriggerEvents allEvents = typeof(TriggerEvents).GetIndividualEnumFlags().Cast <TriggerEvents>().Aggregate((a, b) => a | b); Input.Triggers.Add(new WriteTriggerEventAttribute(allEvents)); }
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)); }
public void Fall(TriggerEvents e = null) { if (e != null) { events += e; } gameObject.GetComponent <Animator>().SetBool("Falling", true); }
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))
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; }
private void ExecuteForChildren(TriggerEvents on) { if (on == TriggerEvents.Init || on == TriggerEvents.DeInit) { foreach (UIComponent <TOwner> child in component.Controls) { child.Triggers.Execute(on); } } }
/// <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; }
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. }
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))
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); } } }
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; } }
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); }
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"); } }
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); } } }
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); }
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); } } }
/// <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"); } }
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; } }
public PressEnterAttribute(TriggerEvents on = TriggerEvents.AfterSet, TriggerPriority priority = TriggerPriority.Medium) : base(OpenQA.Selenium.Keys.Enter, on, priority) { }
protected TriggerAttribute(TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium) { On = on; Priority = priority; }
public CustomWaitForScriptAttribute(string expectedValue, TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium) : base(on, priority) { ExpectedValue = expectedValue; }
public CloseConfirmBoxAttribute(bool accept = true, TriggerEvents on = TriggerEvents.AfterClick, TriggerPriority priority = TriggerPriority.Medium) : base(on, priority) { Accept = accept; }
public InvokeDelegateAttribute(Action actionDelegate, TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium) : base(on, priority) { ActionDelegate = actionDelegate.CheckNotNull(nameof(actionDelegate)); }
protected WaitForAttribute(WaitUntil until, TriggerEvents on, TriggerPriority priority = TriggerPriority.Medium) : base(on, priority) { Until = until; }
public PressTabAttribute(TriggerEvents on = TriggerEvents.AfterSet, TriggerPriority priority = TriggerPriority.Medium) : base(OpenQA.Selenium.Keys.Tab, on, priority) { }
protected void ExecuteTriggers(TriggerEvents on) { Triggers.Execute(on); }
public WaitForAngularJSAjaxAttribute(TriggerEvents on = TriggerEvents.AfterClick, TriggerPriority priority = TriggerPriority.Medium) : base(on, priority) { }