Provides data for the VncServerSession.FramebufferUpdating event.
Inheritance: System.ComponentModel.HandledEventArgs
コード例 #1
0
        protected void RaiseFramebufferUpdating(FramebufferUpdatingEventArgs e)
        {
            var ev = FramebufferUpdating;

            if (ev != null)
            {
                ev(this, e);
            }
        }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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;
        }
コード例 #7
0
 /// <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);
     }
 }
コード例 #8
0
 protected virtual void OnFramebufferUpdating(FramebufferUpdatingEventArgs e)
 {
     RaiseFramebufferUpdating(e);
 }
コード例 #9
0
 /// <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);
 }
コード例 #10
0
        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);
        }