private void OnPlayerUpdated(object sender, UpdatedEventArgs e) { if (e.IsLocal) { var player = e.Player; if (PlayerExtension.IsNoclip) { float movespeed = IsKeyDown(Keys.LeftShift) ? player.moveSpeed * Config.NoclipBoostSpeed : player.moveSpeed * 5; if (player.controlLeft) { PlayerExtension.NoclipPosition += new Vector2(-movespeed, 0); } if (player.controlRight) { PlayerExtension.NoclipPosition += new Vector2(movespeed, 0); } if (player.controlUp) { PlayerExtension.NoclipPosition += new Vector2(0, -movespeed); } if (player.controlDown) { PlayerExtension.NoclipPosition += new Vector2(0, movespeed); } player.gfxOffY = 0; player.position = PlayerExtension.NoclipPosition; } } }
private void OnPlayerUpdated(object sender, UpdatedEventArgs e) { if (e.IsLocal) { var player = e.Player; if (_commands.IsNoclip) { if (player.controlLeft) { _commands.NoclipPosition += new Vector2(-player.moveSpeed, 0); } if (player.controlRight) { _commands.NoclipPosition += new Vector2(player.moveSpeed, 0); } if (player.controlUp) { _commands.NoclipPosition += new Vector2(0, -player.moveSpeed); } if (player.controlDown) { _commands.NoclipPosition += new Vector2(0, player.moveSpeed); } player.gfxOffY = 0; player.position = _commands.NoclipPosition; } } }
private ImmutableArray <DiagnosticData> AdjustInitialDiagnostics( Solution solution, UpdatedEventArgs args, CancellationToken cancellationToken) { // we only reach here if there is the document var document = solution.GetDocument(args.DocumentId); // if there is no source text for this document, we don't populate the initial tags. this behavior is equivalent of existing // behavior in OnDiagnosticsUpdated. if (!document.TryGetText(out var text)) { return(ImmutableArray <DiagnosticData> .Empty); } // GetDiagnostics returns whatever cached diagnostics in the service which can be stale ones. for example, build error will be most likely stale // diagnostics. so here we make sure we filter out any diagnostics that is not in the text range. var builder = ArrayBuilder <DiagnosticData> .GetInstance(); var fullSpan = new TextSpan(0, text.Length); foreach (var diagnostic in diagService.GetDiagnostics( args.Workspace, args.ProjectId, args.DocumentId, args.Id, includeSuppressedDiagnostics: false, cancellationToken: cancellationToken)) { if (fullSpan.Contains(diagnostic.GetExistingOrCalculatedTextSpan(text))) { builder.Add(diagnostic); } } return(builder.ToImmutableAndFree()); }
void OnEngineUpdated(object sender, UpdatedEventArgs e) { if (Updated != null) { Updated(sender, e); } }
public Data(UpdatedEventArgs args, ImmutableArray <DiagnosticData> diagnostics) { this.Workspace = args.Workspace; this.ProjectId = args.ProjectId; this.DocumentId = args.DocumentId; this.Id = args.Id; this.Diagnostics = diagnostics; }
protected virtual void OnUpdated(object sender, UpdatedEventArgs args) { BytesExpected = args.BytesExpected; BytesTransferred = args.BytesTransferred; InProgress = args.InProgress; Total = args.Total; Update(); }
private void SurfaceOnUpdated(UpdatedEventArgs args) { if (_rgbService.IsRenderPaused) { return; } OnFrameRendered(new FrameRenderedEventArgs(_rgbService.BitmapBrush, _rgbService.Surface)); }
private void ProduceTags( TaggerContext <TTag> context, DocumentSnapshotSpan spanToTag, Workspace workspace, Document document, SourceText sourceText, NormalizedSnapshotSpanCollection suppressedDiagnosticsSpans, UpdatedEventArgs updateArgs, CancellationToken cancellationToken) { try { var id = updateArgs.Id; var diagnostics = _diagnosticService.GetDiagnostics( workspace, document.Project.Id, document.Id, id, false, cancellationToken); var isLiveUpdate = id is ISupportLiveUpdate; var requestedSpan = spanToTag.SnapshotSpan; var editorSnapshot = requestedSpan.Snapshot; foreach (var diagnosticData in diagnostics) { if (this.IncludeDiagnostic(diagnosticData)) { // We're going to be retrieving the diagnostics against the last time the engine // computed them against this document *id*. That might have been a different // version of the document vs what we're looking at now. But that's ok: // // 1) GetExistingOrCalculatedTextSpan will ensure that the diagnostics spans are // contained within 'editorSnapshot'. // 2) We'll eventually hear about an update to the diagnostics for this document // for whatever edits happened between the last time and this current snapshot. // So we'll eventually reach a point where the diagnostics exactly match the // editorSnapshot. var diagnosticSpan = diagnosticData.GetExistingOrCalculatedTextSpan(sourceText) .ToSnapshotSpan(editorSnapshot); if (diagnosticSpan.IntersectsWith(requestedSpan) && !IsSuppressed(suppressedDiagnosticsSpans, diagnosticSpan)) { var tagSpan = this.CreateTagSpan(isLiveUpdate, diagnosticSpan, diagnosticData); if (tagSpan != null) { context.AddTag(tagSpan); } } } } } catch (ArgumentOutOfRangeException ex) when(FatalError.ReportWithoutCrash(ex)) { // https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?id=428328&_a=edit&triage=false // explicitly report NFW to find out what is causing us for out of range. // stop crashing on such occations return; } }
private void OnUpdated(IntPtr vector2) { if (scrollableUpdatedEventHandler != null) { UpdatedEventArgs e = new UpdatedEventArgs(); // Populate all members of "e" (UpdatedEventArgs) with real data e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2); //here we send all data to user event handlers scrollableUpdatedEventHandler(this, e); } }
private void OnPlayerUpdated2(object sender, UpdatedEventArgs e) { if (e.IsLocal) { var player = e.Player; if (_commands.DefenseValue != null) { player.statDefense = _commands.DefenseValue.Value; } if (_commands.IsInfiniteAmmo) { foreach (var item in player.inventory) { if (item.ammo != 0 && !item.notAmmo) { item.stack = item.maxStack; } } } if (_commands.IsInfiniteBreath || _commands.IsGodMode) { player.breath = player.breathMax - 1; } if (_commands.IsInfiniteHealth || _commands.IsGodMode) { player.statLife = player.statLifeMax2; } if (_commands.IsInfiniteMana || _commands.IsGodMode) { player.statMana = player.statManaMax2; } if (_commands.IsInfiniteWings) { player.wingTime = 2; } if (_commands.RangeValue != null) { var range = _commands.RangeValue.Value; Player.tileRangeX = range; Player.tileRangeY = range; } if (_commands.SpeedValue != null) { var speed = (float)_commands.SpeedValue; player.maxRunSpeed = speed; player.moveSpeed = speed; player.runAcceleration = speed / 12.5f; } } }
public override void OnItemsUpdated(object sender, UpdatedEventArgs <TCloudItem> e) { if (!IsSenderVisible(sender)) { return; } lock (_pointPlaces) { foreach (var item in e.UpdatedItems) { if (item.Message == GridMessage && item is SlamInfinitePlane) { continue; } var index = _pointPlaces[(sender.GetHashCode(), item.Id)];
public void Updated(object sender, UpdatedEventArgs e) { if (last != null) { foreach (Tuple <int, int, int> tuple in last.Changes) { if (tuple != null) { if (tuple.Item3.Equals(1)) { picBox[tuple.Item1 - 1, tuple.Item2 - 1].Image = Properties.Resources.Filled; } else if (tuple.Item3.Equals(2)) { picBox[tuple.Item1 - 1, tuple.Item2 - 1].Image = Properties.Resources.Cross; } } } } //System.Timers.Timer timer = new System.Timers.Timer(1000); //timer.Elapsed += OnTimer; //timer.AutoReset = false; //timer.Start(); foreach (Tuple <int, int, int> tuple in e.Changes) { if (tuple != null) { if (tuple.Item3.Equals(1)) { picBox[tuple.Item1 - 1, tuple.Item2 - 1].Image = Properties.Resources.New_Filled; } else if (tuple.Item3.Equals(2)) { picBox[tuple.Item1 - 1, tuple.Item2 - 1].Image = Properties.Resources.New_Cross; } } } last = e; Application.DoEvents(); }
void OnWillUpdated(object sender, UpdatedEventArgs e) { if (!_isRenderingCompleted) { return; } _updatesToSkip--; if (_updatesToSkip < 0) { _updatesToSkip = WILL_UPDATE_SKIPS_COUNT; Task.Factory.StartNew <IRenderer>(s => { IRenderer renderer; if (_renderer.TryGetTarget(out renderer)) { var snapshot = Will.Instance.GetWorldSnapshot(); renderer.RenderWorld(snapshot); } else { throw new ArgumentNullException("_renderer"); } return(renderer); }, _renderingContext).ContinueWith(t => { if (t.IsFaulted) { // Log Error call goes here } _isRenderingCompleted = true; }); } }
protected virtual void OnUpdated(UpdatedEventArgs e) { Updated?.Invoke(this, e); }
internal static void InvokeUpdate2(object player) { var args = new UpdatedEventArgs((Player)player); Update2?.Invoke(null, args); }
void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { UpdatedEventArgs ee = new UpdatedEventArgs(); OnUpdatedComplete(this, ee); }
protected virtual void OnFirstUpdateEvent(UpdatedEventArgs e) { if (updateEvent != null) updateEvent(this, e); }
public Data(UpdatedEventArgs args) : this(args, ImmutableArray <DiagnosticData> .Empty) { }
protected virtual void OnUpdated(object sender, UpdatedEventArgs args) { BytesExpected = args.BytesExpected; BytesTransferred = args.BytesTransferred; InProgress = args.InProgress; Total = args.Total; Update (); }
protected virtual void OnUpdated(UpdatedEventArgs e) { if (this.Updated != null) { this.Updated(this, e); } }
public abstract void OnItemsUpdated(object sender, UpdatedEventArgs <TCloudItem> e);
private void ProcessInputDialog_CanProceed(object sender, UpdatedEventArgs e) { btnNext.Enabled = e.CanProceed; btnOK.Enabled = e.CanProceed; }
private void btnOk_Click(object sender, EventArgs e) { if (_FieldLock == false) { /*----naar object schrijven----*/ kla.Naam = txtNaam.Text; kla.Land = txtLand.Text; kla.Gemeente = txtGemeente.Text; kla.Postcode = txtPostcode.Text; kla.Straat = txtStraat.Text ; kla.Nr = txtNr.Text; kla.Bus = txtBus.Text; kla.Tel1 = txtTel1.Text; kla.Tel2 = txtTel2.Text; kla.Contact = txtContact.Text; kla.Btwnr = txtBtw.Text; kla.Reknr = txtRekeningnr.Text; //imgLogo.Image = kla.Logo(); /*------------------------------*/ //imgLogo.Image = kla.Logo(); _Row[1] = txtNaam.Text; _Row[2] = txtLand.Text; _Row[3] = txtGemeente.Text; _Row[12] = txtPostcode.Text; _Row[4] = txtStraat.Text; _Row[5] = txtNr.Text; _Row[6] = txtBus.Text; _Row[10] = txtTel1.Text; _Row[11] = txtTel2.Text; _Row[9] = txtContact.Text; _Row[7] = txtBtw.Text; _Row[13] = txtRekeningnr.Text; if (kla.Save()) { UpdatedEventArgs eventData = new UpdatedEventArgs(); eventData.SomeVal = _Row; // set update event arguments, according to your need OnFirstUpdateEvent(eventData); } } }
private void SurfaceOnUpdated(UpdatedEventArgs args) { OnFrameRendered(new FrameRenderedEventArgs(_rgbService.BitmapBrush, _rgbService.Surface)); }
private static void StatWriter_Updated(object sender, UpdatedEventArgs e) { ConsoleScreen.Title = $"Fortnite Stats Last Updated: {e.UpdatedTime.ToLongTimeString()}"; }