/// <summary> /// Enters the monitor. Dispose the returned IDisposable to leave it. /// </summary> public IDisposable Enter() { if (_count == 0) Entered?.Invoke(this, EventArgs.Empty); _count++; return Disposable.Create(Leave); }
[NotNull] public IScope Enter(object state = null) { lock (mLock) { if (EnterTrigger == ScopeEnterTrigger.Entering) { mOnEnter?.Invoke(); } EnteringOverride(); Entering?.Invoke(this, new EventArgs()); mStateStack.Push(state); Entered?.Invoke(this, new EventArgs()); EnteredOverride(); if (EnterTrigger == ScopeEnterTrigger.Entered) { mOnEnter?.Invoke(); } } return(this); }
private void onMouseMove(object sender, MouseMoveEventArgs e) { if (inputEngine.Mouse.CurrentWindow == Window && e.X >= GlobalX + _hitBox.X && e.X <= GlobalX + _hitBox.X + _hitBox.Width && e.Y >= GlobalY + _hitBox.Y && e.Y <= GlobalY + _hitBox.Y + _hitBox.Height) { if (_state == InteractableState.Normal) { _state = InteractableState.Hover; Entered?.Invoke(this, EventArgs.Empty); } } else { if (_state == InteractableState.Hover) { _state = InteractableState.Normal; Exited?.Invoke(this, EventArgs.Empty); } } if (_state == InteractableState.Down) { tickX = MathUtil.Clamp(GlobalX, GlobalX + barBitmap.Width, inputEngine.Mouse.X) - GlobalX - tickBitmap.Width / 2.0d; needsUpdate = true; ValueChanged?.Invoke(this, EventArgs.Empty); } }
private void Option_MouseEnter(object sender, MouseEventArgs e) { Entered?.Invoke(sender, e); if (!this.OptionCanvas.Children.Contains(_selector)) { this.OptionCanvas.Children.Add(_selector); } TextBlock senderTextBlock = sender as TextBlock; Point location = senderTextBlock.TranslatePoint(new Point(0, 0), OptionCanvas); Point arrowLocation = _selector.TranslatePoint(new Point(0, 0), OptionCanvas); // Don't redraw the arrow if it's already where it should be if (location.Y + 8.0 != arrowLocation.Y) { _selector.BeginBounceAnimation(new Point(location.X - 20.0, location.Y + 8.0)); } foreach (var child in CurrentOptions.Children) { TextBlock option = child as TextBlock; DoubleAnimation deselect = new DoubleAnimation(0.8, new Duration(TimeSpan.FromSeconds(0.0))); option.BeginAnimation(TextBlock.OpacityProperty, deselect); } DoubleAnimation select = new DoubleAnimation(1.0, new Duration(TimeSpan.FromSeconds(0.0))); senderTextBlock.BeginAnimation(TextBlock.OpacityProperty, select); }
private void OnTriggerEnter2D(Collider2D collider) { if (!this.isOpened) { return; } Entered?.Invoke(collider.gameObject); }
public override void Enter() { Debug.Log("SELECT TARGET"); // wait for player to click a target, or cancel _targetController.TargetClicked += OnTargetClicked; _input.PressedCancel += OnPressedCancel; Entered?.Invoke(); }
/// <summary> /// Enters the monitor. Dispose the returned IDisposable to leave it. /// </summary> public IDisposable Enter() { if (_count == 0) { Entered?.Invoke(this, EventArgs.Empty); } _count++; return(this); }
/// <summary> /// Calls the <see cref="onEntered"/> and <see cref="Entered"/> events, if they are valid. /// Prefer <see cref="Entered"/> if you are programmatically adding event handlers at /// runtime. If you are adding event handlers in the Unity Editor, prefer <see /// cref="onEntered"/>. If you are waiting for this event in a subclass of StateController, /// prefer overriding the <see cref="OnEntered"/> method. /// </summary> protected virtual void OnEntered() { if (!skipEvents) { if (onEntered != null) { onEntered.Invoke(); } Entered?.Invoke(this, EventArgs.Empty); } }
/// <summary> /// /// </summary> public override void OnApplyTemplate() { base.OnApplyTemplate(); var PART_TextBox = this.Template.FindName("PART_TextBox", this); if (PART_TextBox != null && PART_TextBox.Is <TextBoxExt>()) { PART_TextBox.As <TextBoxExt>().Entered += (s, e) => Entered?.Invoke(this, e); } }
private void OnTriggerEnter(Collider col) { if (!col.CompareTag("Camera")) { return; } if (Entered != null) { Entered.Invoke(); } }
private void OnTriggerEnter(Collider other) { if (Entered == null) { return; } if (!other.CompareTag("Throwable")) { return; } Entered.Invoke(this); }
private void onMouseMove(object sender, MouseMoveEventArgs e) { if (inputEngine.Mouse.CurrentWindow == Window && e.X >= GlobalX + _hitBox.X && e.X <= GlobalX + _hitBox.X + _hitBox.Width && e.Y >= GlobalY + _hitBox.Y && e.Y <= GlobalY + _hitBox.Y + _hitBox.Height) { if (_state == InteractableState.Normal) { if (_hoverTexture != null) { /*bool update = false; * if (_hitBox.X == X && _hitBox.Y == Y && _hitBox.Width == Width && _hitBox.Height == Height) { * update = true; * }*/ Texture = atlas.GetTexture(_hoverTexture); //if (update) { _hitBox.X = 0.0d; _hitBox.Y = 0.0d; _hitBox.Width = Width; _hitBox.Height = Height; //} } _state = InteractableState.Hover; Entered?.Invoke(this, EventArgs.Empty); } } else { if (_state == InteractableState.Hover) { /*bool update = false; * if (_hitBox.X == X && _hitBox.Y == Y && _hitBox.Width == Width && _hitBox.Height == Height) { * update = true; * }*/ Texture = atlas.GetTexture(_normalTexture); //if (update) { _hitBox.X = 0.0d; _hitBox.Y = 0.0d; _hitBox.Width = Width; _hitBox.Height = Height; //} _state = InteractableState.Normal; Exited?.Invoke(this, EventArgs.Empty); } } }
private void onMouseMove(object sender, MouseMoveEventArgs e) { if (inputEngine.Mouse.CurrentWindow == Window && e.X >= GlobalX + _hitBox.X && e.X <= GlobalX + _hitBox.X + _hitBox.Width && e.Y >= GlobalY + _hitBox.Y && e.Y <= GlobalY + _hitBox.Y + _hitBox.Height) { if (_state == InteractableState.Normal) { _state = InteractableState.Hover; Entered?.Invoke(this, EventArgs.Empty); } } else { if (_state == InteractableState.Hover) { _state = InteractableState.Normal; Exited?.Invoke(this, EventArgs.Empty); } } }
private void OnCollisionEnter(Collision other) => Entered?.Invoke(other);
private void Scene_Entered(object sender, EventArgs e) { Entered?.Invoke(sender, e); }
void OnCollisionEnter2D(Collision2D collision2D) { //Debug.Log("OnCollisionEnter2D"); Entered?.Invoke(this, collision2D); }
private void OnTriggerEnter(Collider other) => Entered?.Invoke(other);
public override bool BecomeFirstResponder() { Entered?.Invoke(this, EventArgs.Empty); return(true); }
/// <summary> /// /// </summary> /// <param name="Text"></param> protected virtual void OnEntered(string Text) { Entered?.Invoke(this, new TextSubmittedEventArgs(Text)); }
protected virtual void OnEntered() { state = AnimationState.FadeIn; Entered?.Invoke(this, new UIMouseEventArgs(Manager.MousePosition)); }
public override void MouseEntered(NSEvent theEvent) { Entered?.Invoke(this, EventArgs.Empty); }
public virtual void OnEntered(EventArgs e) { Entered?.Invoke(this, e); }
private void Enter() { Entered?.Invoke(this); }
private void Collision2DAgentOnEntered(object sender, Collision2D e) => Entered?.Invoke(this, e);
protected virtual void RaiseEntered(StateEnteredEventArgs args) { Entered?.Invoke(this, args); }
public void Enter() { IsActive = true; Entered?.Invoke(this, EventArgs.Empty); }
private async Task Enter_Executed(object arg) { lock (_loginLock) { if (IsProgress) { return; } IsProgress = true; } Error = ""; FullError = null; Enter.CanBeExecuted = false; try { NewServerInfo[] uris; try { var siService = new SIStorageServiceClient(); uris = await siService.GetGameServersUrisAsync(_cancellationTokenSource.Token); } catch { uris = null; } var uri = uris?.FirstOrDefault() ?? new NewServerInfo { Uri = GameServerClientNew.GameServerPredefinedUri, ProtocolVersion = ClientProtocolVersion }; if (uri == null) { Error = Resources.CannotGetServerAddress; return; } if (uri.ProtocolVersion > ClientProtocolVersion) { IsProgress = false; Enter.CanBeExecuted = true; Error = Resources.ObsoleClient; return; } IGameServerClient client = new GameServerClientNew(uri.Uri); await client.OpenAsync(_login, _cancellationTokenSource.Token); Entered?.Invoke(_login, client); } catch (HttpRequestException exc) { var message = new StringBuilder(); var innerExc = exc.InnerException ?? exc; while (innerExc != null) { if (message.Length > 0) { message.AppendLine(); } message.Append(innerExc.Message); innerExc = innerExc.InnerException; } Error = message.ToString(); } catch (Exception exc) { Error = exc.Message; FullError = exc.ToString(); } finally { lock (_loginLock) { IsProgress = false; } Enter.CanBeExecuted = true; } }
public void TriggerEntered() { Entered?.Invoke(this, EventArgs.Empty); }
public void NotifyEntered(Rat rat) { Entered?.Invoke(rat, EventArgs.Empty); }
public void RaiseEntered(StateChangeArgs <TS, TT> e) => Entered?.Invoke(e);