protected virtual bool CanUse() { int layers = this.m_CharacterAnimator.layerCount; for (int i = 0; i < layers; i++) { if (this.m_CharacterAnimator.HasState(i, Animator.StringToHash(this.m_UseState)) && (this.m_CharacterAnimator.GetCurrentAnimatorStateInfo(i).IsName(this.m_UseState) || this.m_CharacterAnimator.IsInTransition(i))) { return(false); } } if (!this.m_CharacterAnimator.GetCurrentAnimatorStateInfo(1).IsTag("Interruptable")) { return(false); } Ray ray = this.m_Camera.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { BaseTrigger trigger = hit.collider.GetComponentInParent <BaseTrigger>(); return(trigger == null || !trigger.enabled); } return(true); }
public void ReceiveTrigger(BaseTrigger trigger, TriggerState state) { if(ActivatesOnce && IsActivated) return; switch(state) { case TriggerState.Activated: if (!ActivatedTriggers.Contains(trigger)) ActivatedTriggers.Add(trigger); break; case TriggerState.Deactivated: if (ActivatedTriggers.Contains(trigger)) ActivatedTriggers.Remove(trigger); break; default: return; } if(CheckRequirements()) { IsActivated = true; DispatchResult(true); } else if(!ActivatesOnce && IsActivated) { IsActivated = false; DispatchResult(false); } }
public void ReceiveTrigger(BaseTrigger trigger, TriggerState state) { if(ActivatesOnce && IsActivated) return; switch(state) { case TriggerState.Activated: if (!ActivatedTriggers.Contains(trigger)) ActivatedTriggers.Add(trigger); break; case TriggerState.Deactivated: if (ActivatedTriggers.Contains(trigger)) ActivatedTriggers.Remove(trigger); break; default: return; } if(CheckRequirements()) { IsActivated = true; DispatchResult(true); } else if(!ActivatesOnce && IsActivated) { IsActivated = false; DispatchResult(false); } }
public void InstantiateLevelObject(LevelObject levelObject) { ELevelObjectType type = levelObject.LevelObjectType; GameObject levelGameObject = InstantiateObject(_currentTheme, type.ToString()); BaseTrigger trigger = null; BaseTriggerListener listener = null; if (levelGameObject != null) { switch (type) { case ELevelObjectType.BUTTON: case ELevelObjectType.PORTAL: case ELevelObjectType.START: case ELevelObjectType.TRAP: case ELevelObjectType.EXIT: trigger = levelGameObject.GetComponent <BaseTrigger>(); levelGameObject.transform.position = new Vector3(levelObject.Position.x, GridSize.y - levelObject.Position.y, 1); trigger.LevelObjectReference = levelObject; break; case ELevelObjectType.DOOR: case ELevelObjectType.PORTALTARGET: listener = levelGameObject.GetComponent <BaseTriggerListener>(); levelGameObject.transform.position = new Vector3(levelObject.Position.x, GridSize.y - levelObject.Position.y, 1); listener.LevelObjectReference = levelObject; break; } } }
private static BaseTrigger AddTrigger(string name, TriggerType type) { if (name == null || type.ToString() == null) { Log.Instance.Error("{0}/ChatBot (unknown trigger): Trigger not defined correctly. Not loading...", name); return(null); } BaseTrigger trigger = triggerFactory.CreateTrigger(type, name); try { Log.Instance.Debug(username + "/ChatBot: Testing onload for {0} trigger {1}", type, name); if (trigger != null && trigger.OnLoad()) { Log.Instance.Silly(username + "/ChatBot: onload success for {0} trigger {1}", type, name); triggers.Add(trigger); return(trigger); } else if (trigger != null) { Log.Instance.Error(username + "/ChatBot: Error loading {0} trigger {1}", type, name); return(null); } } catch (Exception e) { Log.Instance.Error(username + "/ChatBot: Error loading {0} trigger {1}: {2}", type, name, e.StackTrace); return(null); } return(null); }
public Tile(Board board, TileBehaviour behaviour, Vector2Int pos, TileType type, BaseTrigger trigger) { Behaviour = behaviour; Position = pos; Type = type; Trigger = trigger; Board = board; }
public bool Detectou() { if(!trigger) trigger = GetComponent<BaseTrigger>(); if(trigger.estado == Definicoes.DETECTOU) return true; return false; }
private void OnTriggerExit(Collider other) { BaseTrigger trigger = other.gameObject.GetComponent <BaseTrigger>(); if (trigger != null) { TriggerExitEvent.Invoke(trigger); } }
private void OnTriggerEnter(Collider other) { BaseTrigger trigger = other.GetComponent <BaseTrigger>(); if (trigger != null) { trigger.OnTriggered(); } }
private void OnTriggerExit(Collider other) { BaseTrigger trigger = other.GetComponent <BaseTrigger>(); if (trigger != null) { trigger.TriggerDeactivated(); } }
private static bool DrawArrowsPlusAndMinus(int index, int arraySize, ref SerializedObject m_Object, ref SerializedProperty triggersProperty, AIBehaviorsStyles styles, string propertyName, string firstTriggerType) { SerializedProperty prop = triggersProperty.GetArrayElementAtIndex(index); if (prop != null) { Object obj = prop.objectReferenceValue; if (obj != null) { bool oldEnabled = GUI.enabled; GUI.enabled = index > 0; if (GUILayout.Button(styles.blankContent, styles.upStyle, GUILayout.MaxWidth(styles.arrowButtonWidths))) { triggersProperty.MoveArrayElement(index, index - 1); } GUI.enabled = index < arraySize - 1; if (GUILayout.Button(styles.blankContent, styles.downStyle, GUILayout.MaxWidth(styles.arrowButtonWidths))) { triggersProperty.MoveArrayElement(index, index + 1); } GUI.enabled = true; if (GUILayout.Button(styles.blankContent, styles.addStyle, GUILayout.MaxWidth(styles.addRemoveButtonWidths))) { GameObject go = (m_Object.targetObject as Component).gameObject; triggersProperty.InsertArrayElementAtIndex(index); triggersProperty.GetArrayElementAtIndex(index + 1).objectReferenceValue = ComponentHelper.AddComponentByName(go, firstTriggerType); } if (GUILayout.Button(styles.blankContent, styles.removeStyle, GUILayout.MaxWidth(styles.addRemoveButtonWidths))) { BaseTrigger baseTrigger = prop.objectReferenceValue as BaseTrigger; #if UNITY_4_3 Undo.RegisterFullObjectHierarchyUndo(baseTrigger); #else Undo.RegisterFullObjectHierarchyUndo(baseTrigger, "RemovedTrigger"); #endif AIBehaviorsAssignableObjectArray.RemoveObjectAtIndex(m_Object, index, propertyName); DestroyTriggers(baseTrigger.subTriggers); Object.DestroyImmediate(baseTrigger, true); return(true); } GUI.enabled = oldEnabled; } } return(false); }
private ITrigger SetUniqueTriggerFrom(string line) { var result = new BaseTrigger(); var s = line.Split(':').RemoveEmptyItems(); result.Link = s[1].Trim().Replace(".", ""); result.ChanceToTrigger = 100; return(result); }
bool isBadTrigger(BaseTrigger trig1, BaseTrigger trig2, bool andOr) { // reminder: AND = false, OR = true if (((trig1.Condition == 0 || trig2.Condition == 0) && andOr) || ((trig1.Condition == 10 || trig2.Condition == 10) && !andOr)) { return(true); } return(false); }
private void Start() { m_Trigger = GetComponent <BaseTrigger>(); EventHandler.Register <bool>(gameObject, "OnCameraRaycast", OnCameraRaycast); EventHandler.Register <bool>(gameObject, "OnMouseRaycast", OnMouseRaycast); if (this.m_DisplayType.HasFlag <DisplayNameType>(DisplayNameType.Always)) { DoDisplayName(true); } }
private void TriggerEvent(BaseTrigger trigger) { if (trigger is TextTrigger) { TriggerTextEvent((TextTrigger)trigger); } if (trigger is PlaceDoubleTileTrigger) { TriggerPlaceDoubleTileEvent((PlaceDoubleTileTrigger)trigger); } }
private void Start() { m_Trigger = GetComponent <BaseTrigger>(); EventHandler.Register(gameObject, "OnPointerEnterTrigger", OnPointerEnterTrigger); EventHandler.Register(gameObject, "OnPointerExitTrigger", OnPointerExitTrigger); if (this.m_DisplayType.HasFlag <DisplayNameType>(DisplayNameType.Always)) { DoDisplayName(true); } }
public void Update(uint elapsed) { IDictionaryEnumerator enumerator = mTriggers.GetEnumerator(); while (enumerator.MoveNext()) { BaseTrigger trigger = enumerator.Value as BaseTrigger; if (trigger != null) { trigger.Update(elapsed); } } }
public void Register(BaseTrigger trig) { if (trig is ProcessTrigger) { var trigger = (ProcessTrigger)trig; if (!string.IsNullOrWhiteSpace(trigger.Text)) { if (trigger.Option == ProcessEventKind.Start) { ProcessWatcher.Current.RegisterStart(trigger.Text, () => Triggered?.Invoke(trig)); } else { ProcessWatcher.Current.RegisterStop(trigger.Text, () => Triggered?.Invoke(trig)); } } } else if (trig is EventTrigger) { _eventTriggers.Add((EventTrigger)trig); } else if (trig is DeviceEventTrigger) { _audioManager.Register(trig); } else if (trig is AppEventTrigger) { _audioManager.Register(trig); } else if (trig is HotkeyTrigger) { var trigger = (HotkeyTrigger)trig; HotkeyManager.Current.Register(trigger.Option); HotkeyManager.Current.KeyPressed += (data) => { if (data.Equals(trigger.Option)) { Triggered?.Invoke(trig); } }; } else if (trig is ContextMenuTrigger) { // Nothing to do. } else { throw new NotImplementedException(); } }
public void Stop() { if (event_ != null) { event_.Set(); } runState_ = RunState.RUNSTATE_STOP; if (trigger_ != null) { trigger_.stopState_ = true; trigger_ = null; } t_ = null; }
public void Register(BaseTrigger trigger) { if (trigger is DeviceEventTrigger) { _deviceTriggers.Add((DeviceEventTrigger)trigger); } else if (trigger is AppEventTrigger) { _appTriggers.Add((AppEventTrigger)trigger); } else { throw new NotImplementedException(); } }
public bool Run() { if (runState_ != RunState.RUNSTATE_INIT) { return(false); } if (toolObj_ == null) { return(false); } if (toolObj_.children == null) { return(false); } var l = toolObj_.children; foreach (ToolObj p in l) { if (p.type == PlugType.PT_TRIGGER) { trigger_ = p.plug_ as BaseTrigger; break; } } if (trigger_ != null) { trigger_.Notify_ = TriggerNotify; trigger_.data_ = l; trigger_.stopState_ = false; } runState_ = RunState.RUNSTATE_RUNNING; t_ = new Thread(() => { if (trigger_ == null) { TriggerNotify(l); } else { trigger_.RunTrigger(); } Stop(); runState_ = RunState.RUNSTATE_INIT; }); t_.IsBackground = true; t_.Start(); return(true); }
public bool StopTrigger(string name) { if (!mTriggers.ContainsKey(name)) { return(false); } BaseTrigger trigger = mTriggers[name] as BaseTrigger; if (trigger != null) { trigger.Stop(); } return(true); }
private ITrigger SetTriggerFrom(string line) { if (!line.Contains("%")) { return(SetUniqueTriggerFrom(line)); } var result = new BaseTrigger { Link = line.ExtractLinkWithoutPercentage(), ChanceToTrigger = line.ExtractPercentageChancesFromLink() }; return(result); }
/// <summary> /// Trigger the Client. /// </summary> /// <param name="actorName">Destination Actor Name.</param> /// <param name="trigger">Trigger message.</param> /// <param name="awaitCompletion">Boolean indicating whether this a synchronous call or not.</param> /// <returns>Boolean indicating success or failure.</returns> public bool TriggerClient(ActorName actorName, BaseTrigger trigger, bool awaitCompletion) { _awaitCompletion = awaitCompletion; Hl7Trigger hl7Trigger = (Hl7Trigger)trigger; _triggerQueue.Enqueue(hl7Trigger); // Check if this is a synchronous call or not if (_awaitCompletion == true) { // Timeout of 0 means "no timeout". _semaphore.Wait(0); } return(true); }
/// <summary> /// Gets all the triggers that would receive events from the specified transform and puts them /// into the specified list. /// </summary> /// <typeparam name="TTrigger">The trigger type.</typeparam> /// <param name="transform">The specified transform.</param> public static void GetTriggers <TTrigger>(Transform transform, List <TTrigger> results) where TTrigger : BaseTrigger { results.Clear(); var check = transform; while (check != null) { var trigger = check.GetComponent <TTrigger>(); if (BaseTrigger.ReceivesEvents(trigger, transform)) { results.Add(trigger); } check = check.parent; } }
private static bool DrawTriggerSelectionPopup(string[] triggerTypeNames, ref SerializedProperty triggersProperty, int index) { BaseTrigger trigger = triggersProperty.GetArrayElementAtIndex(index).objectReferenceValue as BaseTrigger; int initialSelection = 0; int newSelection = 0; for (int i = 0; i < triggerTypeNames.Length; i++) { if (trigger != null) { if (trigger.GetType().Name == triggerTypeNames[i]) { initialSelection = i; break; } } } newSelection = EditorGUILayout.Popup(initialSelection, triggerTypeNames, EditorStyles.popup); if (newSelection != initialSelection) { GameObject triggerObject = trigger.gameObject; BaseTrigger[] triggers = trigger.subTriggers; BaseTrigger newTrigger; #if UNITY_4_3 Undo.RegisterFullObjectHierarchyUndo(triggerObject.transform.root.gameObject); #else Undo.RegisterFullObjectHierarchyUndo(triggerObject.transform.root.gameObject, "AddTrigger"); #endif newTrigger = ComponentHelper.AddComponentByName(triggerObject, triggerTypeNames[newSelection]) as BaseTrigger; Object.DestroyImmediate(trigger, true); newTrigger.subTriggers = triggers; triggersProperty.GetArrayElementAtIndex(index).objectReferenceValue = newTrigger; return(true); } return(false); }
private async void chatbotsList_SelectionChanged(object sender, SelectionChangedEventArgs e) { addedTriggersListBox.Items.Clear(); if (e.AddedItems[0].ToString() != "" && e.AddedItems[0].ToString() != null) { Bot.userDir = await Bot.folder.GetFolderAsync(e.AddedItems[0].ToString()); Bot.triggerDir = await Bot.userDir.GetFolderAsync("triggers"); IReadOnlyList <StorageFile> files = await Bot.triggerDir.GetFilesAsync(); foreach (StorageFile file in files) { string text = await FileIO.ReadTextAsync(file); TriggerOptionsBase options = JsonConvert.DeserializeObject <TriggerOptionsBase>(text); addedTriggersListBox.Items.Add(options.Name + " - " + options.Type.ToString()); BaseTrigger trigger = (BaseTrigger)Activator.CreateInstance(Type.GetType("Chaos.Triggers." + options.Type.ToString()), options.Type, options.Name, options); Bot.Triggers.Add(trigger); } } }
static public Tile CreateTile( Transform container, Board board, Vector2Int pos, TileType type) { // Make the two pieces TileBehaviour tileBehaviour = Object.Instantiate <TileBehaviour> (type.Prefab, container); BaseTrigger trigger = null; if (type.TriggerType == TileType.TriggerTypes.ENERGY_REFILL) { trigger = new EnergyFillTrigger(type.energyRefillTriggerData); } else if (type.TriggerType == TileType.TriggerTypes.GOAL) { trigger = new GoalTrigger(); } else if (type.TriggerType == TileType.TriggerTypes.SPIKE_TRAP) { trigger = new SpikeTrapTrigger(type.spikeTrapTriggerData); } else if (type.TriggerType == TileType.TriggerTypes.SWITCH) { trigger = new SwitchTrigger(type.switchTriggerData); } else if (type.TriggerType == TileType.TriggerTypes.ARROW_TRAP) { trigger = new ArrowTrapTrigger(type.arrowTrapTriggerData); } Tile tile = new Tile(board, tileBehaviour, pos, type, trigger); tileBehaviour.UpdateSprite(type.Image); tileBehaviour.UpdatePosition(pos); return(tile); }
/// <summary> /// Add a reponse trigger to the Actor. /// </summary> /// <param name="actorType">Destination Actor Type.</param> /// <param name="trigger">Trigger message.</param> public void AddResponseTriggerToActor(ActorTypeEnum actorType, BaseTrigger trigger) { // can only load and actor that is started if (_actorState == ActorStateEnum.ActorStarted) { ActorNameCollection activeDestinationActors = ActorConnectionCollection.IsEnabled(actorType); foreach(ActorName activeActorName in activeDestinationActors) { if (trigger is Hl7Trigger) { Hl7Server hl7Server = GetHl7Server(activeActorName); if ((hl7Server != null) && (hl7Server is Hl7QueryServer)) { Hl7QueryServer hl7QueryServer = (Hl7QueryServer)hl7Server; hl7QueryServer.AddResponseTrigger(activeActorName, trigger); } } } } }
/// <summary> /// Add response trigger to server. /// </summary> /// <param name="actorName">Destination Actor Name.</param> /// <param name="trigger">Trigger message.</param> public void AddResponseTrigger(ActorName actorName, BaseTrigger trigger) { Hl7Trigger hl7Trigger = (Hl7Trigger) trigger; _responseList.Add(hl7Trigger); }
/// <summary> /// Starts the bot /// </summary> /// <param name="_username"></param> /// <param name="_password"></param> /// <param name="cll"></param> /// <param name="fll"></param> /// <param name="_logFile"></param> /// <param name="_displayName"></param> /// <param name="_sentryFile"></param> public static void Start(string _username, string _password, string cll, string fll, string _logFile, string _displayName, string _sentryFile) { username = _username; logFile = _logFile; password = _password; displayName = _displayName; sentryFile = _sentryFile; CLL = cll; FLL = fll; if (!File.Exists(username + "/login.json")) { MessageBoxResult save = MessageBox.Show("Save login information to file?", "Save Data", MessageBoxButton.YesNo, MessageBoxImage.Question); if (save == MessageBoxResult.Yes) { WriteData(); } } if (sharedSecret != "") { steamGuardAccount.SharedSecret = sharedSecret; } SubForCB(); if (Directory.Exists(username + "/triggers/") && Directory.GetFiles(username + "/triggers/").Length > 0) { if (triggers.Count > 0) { List <BaseTrigger> oldTriggers = BaseTrigger.ReadTriggers(); List <BaseTrigger> newTriggers = triggers; Log.Instance.Verbose("Saving triggers..."); int count = triggers.Count; foreach (BaseTrigger trigger in newTriggers) { Log.Instance.Debug("Saving triggers, " + count + " left"); trigger.SaveTrigger(); Log.Instance.Silly("Trigger {0}/{1} saved", trigger.Name, trigger.Type.ToString()); count--; } Log.Instance.Verbose("Successfully read trigger data from " + username + "/triggers/ and from triggers window"); triggers = oldTriggers.Concat(newTriggers).ToList(); } else { Log.Instance.Verbose("Loading triggers..."); triggers = BaseTrigger.ReadTriggers(); Log.Instance.Verbose("Successfully read trigger data from " + username + "/triggers/"); } } else { if (triggers.Count > 0) { Log.Instance.Verbose("Saving triggers..."); int count = triggers.Count; foreach (BaseTrigger trigger in triggers) { Log.Instance.Debug("Saving triggers, " + count + " left"); trigger.SaveTrigger(); // save new triggers to file Log.Instance.Silly("Trigger {0}/{1} saved", trigger.Name, trigger.Type.ToString()); count--; } Log.Instance.Verbose("Successfully read trigger data from triggers window"); } } isRunning = true; foreach (BaseTrigger trigger in triggers) { trigger.OnLoad(); } Log.Instance.Silly("Updating SteamKit2 servers..."); SteamDirectory.Initialize().Wait(); Log.Instance.Verbose("Connecting to Steam..."); Connect(); while (isRunning) { manager.RunWaitCallbacks(TimeSpan.FromSeconds(1)); } }
/// <summary> /// Trigger the Actor Instances of the given Actor Type. /// </summary> /// <param name="actorType">Destination Actor Type.</param> /// <param name="trigger">Trigger message.</param> /// <param name="awaitCompletion">Boolean indicating whether this a synchronous call or not.</param> /// <returns>Boolean indicating success or failure.</returns> public bool TriggerActorInstances(ActorTypeEnum actorType, BaseTrigger trigger, bool awaitCompletion) { bool triggerResult = false; // can only trigger an actor that is started if (_actorState == ActorStateEnum.ActorStarted) { triggerResult = true; ActorNameCollection activeDestinationActors = ActorConnectionCollection.IsEnabled(actorType); foreach(ActorName activeActorName in activeDestinationActors) { if (trigger is Hl7Trigger) { Hl7Client hl7Client = GetHl7Client(activeActorName); if (hl7Client != null) { if (hl7Client.TriggerClient(activeActorName, trigger, awaitCompletion) == false) { // set returned result - but continue with other triggers triggerResult = false; } } } else { DicomClient dicomClient = GetDicomClient(activeActorName); if (dicomClient != null) { if (dicomClient.TriggerClient(activeActorName, trigger, awaitCompletion) == false) { // set returned result - but continue with other triggers triggerResult = false; } } } } } return triggerResult; }
/// <summary> /// Enqueue a Trigger message. /// </summary> /// <param name="trigger">Trigger message.</param> public void Enqueue(BaseTrigger trigger) { _queue.Enqueue(trigger); }
/// <summary> /// Adds an object to the end of the <see cref="BaseTriggerCollection"/>. /// </summary> /// <param name="value">The <see cref="BaseTrigger"/> to be added to the end of the <see cref="BaseTriggerCollection"/>.</param> /// <returns>The <see cref="BaseTriggerCollection"/> index at which the value has been added.</returns> public int Add(BaseTrigger value) { return (List.Add(value)); }
public virtual void Start () { trigger = GetComponent<BaseTrigger>(); }
/// <summary> /// Removes the first occurrence of a specific <see cref="BaseTrigger"/> from the <see cref="BaseTriggerCollection"/>. /// </summary> /// <param name="value">The <see cref="BaseTrigger"/> to remove from the <see cref="BaseTriggerCollection"/>.</param> public void Remove(BaseTrigger value) { List.Remove(value); }
/// <summary> /// Trigger the Client. /// </summary> /// <param name="actorName">Destination Actor Name.</param> /// <param name="trigger">Trigger message.</param> /// <param name="awaitCompletion">Boolean indicating whether this a synchronous call or not.</param> /// <returns>Boolean indicating success or failure.</returns> public bool TriggerClient(ActorName actorName, BaseTrigger trigger, bool awaitCompletion) { _awaitCompletion = awaitCompletion; Hl7Trigger hl7Trigger = (Hl7Trigger) trigger; _triggerQueue.Enqueue(hl7Trigger); // Check if this is a synchronous call or not if (_awaitCompletion == true) { // Timeout of 0 means "no timeout". _semaphore.Wait(0); } return true; }
/// <summary> /// Trigger the Client. /// </summary> /// <param name="actorName">Destination Actor Name.</param> /// <param name="trigger">Trigger message.</param> /// <param name="awaitCompletion">Boolean indicating whether this a synchronous call or not.</param> /// <returns>Boolean indicating success or failure.</returns> public bool TriggerClient(ActorName actorName, BaseTrigger trigger, bool awaitCompletion) { DicomTrigger dicomTrigger = (DicomTrigger) trigger; _scu.SignalCompletion = awaitCompletion; // determine how the handle the trigger - in a single association or not if (dicomTrigger.HandleInSingleAssociation == true) { // set the dicom messages to send DicomMessageCollection dicomMessageCollection = new DicomMessageCollection(); foreach (DicomTriggerItem dicomTriggerItem in dicomTrigger.TriggerItems) { dicomMessageCollection.Add(dicomTriggerItem.Message); } // set the presentation contexts for the association PresentationContext[] presentationContexts = SetPresentationContexts(dicomTrigger); // send in single association _scu.TriggerSendAssociation(dicomMessageCollection, presentationContexts); // Check if this is a synchronous call or not // - timeout of 0 means "no timeout". if (awaitCompletion == true) { _semaphore.Wait(0); } } else { // send the triggers in separate associations foreach (DicomTriggerItem dicomTriggerItem in dicomTrigger.TriggerItems) { // check if the sop class uid and transfer syntax are being explicitly defined if ((dicomTriggerItem.SopClassUid != System.String.Empty) && (dicomTriggerItem.TransferSyntaxes.Length != 0)) { // use the given presentation context PresentationContext[] presentationContexts = new PresentationContext[1]; presentationContexts[0] = new PresentationContext(dicomTriggerItem.SopClassUid, MergeTransferSyntaxes(dicomTriggerItem.TransferSyntaxes)); _scu.TriggerSendAssociation(dicomTriggerItem.Message, presentationContexts); } else { // use the initial presentation context _scu.TriggerSendAssociation(dicomTriggerItem.Message, _presentationContexts); } // Check if this is a synchronous call or not // - timeout of 0 means "no timeout". if (awaitCompletion == true) { _semaphore.Wait(0); } } } // return a boolean indicating if the trigger was processed successfully or not return _scu.ProcessTriggerResult; }
public void AddTrigger(BaseTrigger trigger) { RequiredTriggers.Add(trigger); }
/// <summary> /// Add response trigger to server. /// </summary> /// <param name="actorName">Destination Actor Name.</param> /// <param name="trigger">Trigger message.</param> public void AddResponseTrigger(ActorName actorName, BaseTrigger trigger) { Hl7Trigger hl7Trigger = (Hl7Trigger)trigger; _responseList.Add(hl7Trigger); }
private void OnPlayerTriggerExited(BaseTrigger trigger) { trigger.TriggerDeactivated(); }
/// <summary> /// Copies the elements of the <see cref="ICollection"/> to a strong-typed <c>BaseTrigger[]</c>, /// starting at a particular <c>BaseTrigger[]</c> index. /// </summary> /// <param name="array"> /// The one-dimensional <c>BaseTrigger[]</c> that is the destination of the elements /// copied from <see cref="ICollection"/>. /// The <c>BaseTrigger[]</c> must have zero-based indexing. /// </param> /// <param name="index"> /// The zero-based index in array at which copying begins. /// </param> /// <remarks> /// Provides the strongly typed member for <see cref="ICollection"/>. /// </remarks> public void CopyTo(BaseTrigger[] array, int index) { ((ICollection)this).CopyTo(array, index); }
/// <summary> /// Determines whether the <see cref="BaseTriggerCollection"/> contains a specific element. /// </summary> /// <param name="value">The <see cref="BaseTrigger"/> to locate in the <see cref="BaseTriggerCollection"/>.</param> /// <returns> /// <c>true</c> if the <see cref="BaseTriggerCollection"/> contains the specified value; /// otherwise, <c>false</c>. /// </returns> public bool Contains(BaseTrigger value) { // If value is not of type Code, this will return false. return (List.Contains(value)); }
public CameraZoomTrigger(BaseTrigger trigger) { this.trigger = trigger; initialize(); }
private static bool ShouldRunFirst(BaseTrigger trigger) { var execute = (Func <DiscordSocketClient, SocketMessage, Task>)trigger.Execute; return(execute.Method.GetCustomAttribute <ShouldRunFirstAttribute>() != null); }
/// <summary> /// Inserts an <see cref="BaseTrigger"/> element into the <see cref="BaseTriggerCollection"/> at the specified index. /// </summary> /// <param name="index">The zero-based index at which value should be inserted.</param> /// <param name="value">The <see cref="BaseTrigger"/> to insert.</param> public void Insert(int index, BaseTrigger value) { List.Insert(index, value); }
/// <summary> /// Searches for the specified <see cref="BaseTrigger"/> and /// returns the zero-based index of the first occurrence within the entire <see cref="BaseTriggerCollection"/>. /// </summary> /// <param name="value">The <see cref="BaseTrigger"/> to locate in the <see cref="BaseTriggerCollection"/>.</param> /// <returns> /// The zero-based index of the first occurrence of value within the entire <see cref="BaseTriggerCollection"/>, /// if found; otherwise, -1. /// </returns> public int IndexOf(BaseTrigger value) { return (List.IndexOf(value)); }