protected void RaiseFramebufferUpdating(FramebufferUpdatingEventArgs e) { var ev = FramebufferUpdating; if (ev != null) { ev(this, e); } }
/// <summary> /// Raises the <see cref="FramebufferUpdating"/> event. /// </summary> /// <param name="e"> /// The event arguments. /// </param> protected virtual void OnFramebufferUpdating(FramebufferUpdatingEventArgs e) { var ev = this.FramebufferUpdating; if (ev != null) { ev(this, e); } }
internal bool FramebufferSendChanges() { var e = new FramebufferUpdatingEventArgs(); lock (this.FramebufferUpdateRequestLock) { if (this.FramebufferUpdateRequest != null) { var fbSource = this.fbSource; if (fbSource != null) { try { var newFramebuffer = fbSource.Capture(); if (newFramebuffer != null && newFramebuffer != this.Framebuffer) { this.Framebuffer = newFramebuffer; } } catch (Exception exc) { this.logger?.Log(LogLevel.Error, () => $"Capturing the framebuffer source failed: {exc}."); } } this.OnFramebufferCapturing(); this.OnFramebufferUpdating(e); if (!e.Handled) { if (this.fbuAutoCache == null || this.fbuAutoCache.Framebuffer != this.Framebuffer) { this.fbuAutoCache = this.CreateFramebufferCache(this.Framebuffer, this.logger); } e.Handled = true; e.SentChanges = this.fbuAutoCache.RespondToUpdateRequest(this); } } } return(e.SentChanges); }
bool FramebufferSendChanges() { var e = new FramebufferUpdatingEventArgs(); lock (FramebufferUpdateRequestLock) { if (FramebufferUpdateRequest != null) { var fbSource = _fbSource; if (fbSource != null) { var newFramebuffer = fbSource.Capture(); if (newFramebuffer != null && newFramebuffer != Framebuffer) { Framebuffer = newFramebuffer; } } OnFramebufferCapturing(); OnFramebufferUpdating(e); if (!e.Handled) { if (_fbuAutoCache == null || _fbuAutoCache.Framebuffer != Framebuffer) { _fbuAutoCache = new VncFramebufferCache(Framebuffer); } e.Handled = true; e.SentChanges = _fbuAutoCache.RespondToUpdateRequest(this); } } } return(e.SentChanges); }
private bool FramebufferSendChanges() { var e = new FramebufferUpdatingEventArgs(); lock (this.FramebufferUpdateRequestLock) { if (this.FramebufferUpdateRequest != null) { var fbSource = this.fbSource; if (fbSource != null) { var newFramebuffer = fbSource.Capture(); if (newFramebuffer != null && newFramebuffer != this.Framebuffer) { this.Framebuffer = newFramebuffer; } } this.OnFramebufferCapturing(); this.OnFramebufferUpdating(e); if (!e.Handled) { if (this.fbuAutoCache == null || this.fbuAutoCache.Framebuffer != this.Framebuffer) { this.fbuAutoCache = this.CreateFramebufferCache(this.Framebuffer, this.logger); } e.Handled = true; e.SentChanges = this.fbuAutoCache.RespondToUpdateRequest(this); } } } return(e.SentChanges); }
private bool FramebufferSendChanges() { var e = new FramebufferUpdatingEventArgs(); lock (this.FramebufferUpdateRequestLock) { if (this.FramebufferUpdateRequest != null) { var fbSource = this.fbSource; if (fbSource != null) { var newFramebuffer = fbSource.Capture(); if (newFramebuffer != null && newFramebuffer != this.Framebuffer) { this.Framebuffer = newFramebuffer; } } this.OnFramebufferCapturing(); this.OnFramebufferUpdating(e); if (!e.Handled) { if (this.fbuAutoCache == null || this.fbuAutoCache.Framebuffer != this.Framebuffer) { this.fbuAutoCache = new VncFramebufferCache(this.Framebuffer); } e.Handled = true; e.SentChanges = this.fbuAutoCache.RespondToUpdateRequest(this); } } } return e.SentChanges; }
protected virtual void OnFramebufferUpdating(FramebufferUpdatingEventArgs e) { RaiseFramebufferUpdating(e); }
/// <summary> /// Raises the <see cref="FramebufferUpdating"/> event. /// </summary> /// <param name="e"> /// The event arguments. /// </param> protected virtual void OnFramebufferUpdating(FramebufferUpdatingEventArgs e) { this.FramebufferUpdating?.Invoke(this, e); }
internal bool FramebufferSendChanges() { var e = new FramebufferUpdatingEventArgs(); lock (this.FramebufferUpdateRequestLock) { if (this.FramebufferUpdateRequest == null) { var incremental = false; if (regionCurr == -1) { regionCurr = 0; incremental = true; } ; var width = (Framebuffer.Width / regionSize); var height = Framebuffer.Height; var x = ((regionCurr % regionSize) * width); regionCurr++; if (regionCurr >= regionSize) { regionCurr = 0; } this.FramebufferUpdateRequest = new FramebufferUpdateRequest( incremental, new VncRectangle(x, 0, width, height)); } if (this.FramebufferUpdateRequest != null) { var fbSource = this.fbSource; if (fbSource != null) { //try //{ var newFramebuffer = fbSource.Capture(); if (newFramebuffer != null && newFramebuffer != this.Framebuffer) { this.Framebuffer = newFramebuffer; } //} //catch (Exception exc) //{ // this.logger?.Log(LogLevel.Error, () => $"Capturing the framebuffer source failed: {exc}."); //} } this.OnFramebufferCapturing(); this.OnFramebufferUpdating(e); if (!e.Handled) { if (this.fbuAutoCache == null || this.fbuAutoCache.Framebuffer != this.Framebuffer) { this.fbuAutoCache = this.CreateFramebufferCache(this.Framebuffer, this.logger); } e.Handled = true; e.SentChanges = this.fbuAutoCache.RespondToUpdateRequest(this); } } } return(e.SentChanges); }