/// <summary> /// Raises the <see cref="FramebufferChanged"/> event. /// </summary> /// <param name="e"> /// A <see cref="FramebufferChangedEventArgs"/> that describes the changes /// in the framebuffer. /// </param> protected virtual void OnFramebufferChanged(FramebufferChangedEventArgs e) { var ev = this.FramebufferChanged; if (ev != null) { ev(this, e); } }
protected void RaiseFramebufferChanged(FramebufferChangedEventArgs e) { var ev = FramebufferChanged; if (ev != null) { ev(this, e); } }
/// <summary> /// Raises the <see cref="FramebufferChanged"/> event. /// </summary> /// <param name="e"> /// A <see cref="FramebufferChangedEventArgs"/> that describes the changes /// in the framebuffer. /// </param> protected virtual void OnFramebufferChanged(FramebufferChangedEventArgs e) { this.FramebufferChanged?.Invoke(this, e); }
protected virtual void OnFramebufferChanged(FramebufferChangedEventArgs e) { RaiseFramebufferChanged(e); }
void HandleFramebufferChanged(object sender, FramebufferChangedEventArgs e) { BeginInvoke(new Action(() => { if (DesignMode) { return; } if (_client == null) { return; } var framebuffer = _client.Framebuffer; if (framebuffer == null) { return; } lock (framebuffer.SyncRoot) { UpdateFramebuffer(false, framebuffer); if (_bitmap != null) { for (int i = 0; i < e.RectangleCount; i++) { var rect = e.GetRectangle(i); VncBitmap.CopyFromFramebuffer(framebuffer, rect, _bitmap, rect.X, rect.Y); } } } for (int i = 0; i < e.RectangleCount; i++) { var rect = e.GetRectangle(i); Invalidate(new Rectangle(rect.X, rect.Y, rect.Width, rect.Height)); } })); }