Example #1
0
        /// <summary>
        /// On autohide pane preview button
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event argument</param>
        private void OnBottomPaneShowPreview(object sender, PreviewEventArgs e)
        {
            if (_autoShowPanel != null)
            {
                return;
            }

            _previewPane.Size = _topBottomPreviewSize;

            int x = e.ButtonLocation.X;

            if (x < BottomAutohideButtons.Left)
            {
                x = BottomAutohideButtons.Left;
            }
            else if (x + _previewPane.Width > BottomAutohideButtons.Right)
            {
                x = BottomAutohideButtons.Right - _previewPane.Width;
            }

            _previewPane.Left = x;

            _previewPane.Top = BottomAutohideButtons.Top - _previewPane.Height;

            if (_previewPane.Renderer != null)
            {
                _previewPane.Renderer.SelectedForm = e.Form;
            }

            _previewPane.Visible = PreviewRenderer != null;
        }
Example #2
0
        /// <summary>
        /// On autohide pane preview button
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">event argument</param>
        private void OnRightPaneShowPreview(object sender, PreviewEventArgs e)
        {
            if (_autoShowPanel != null)
            {
                return;
            }

            _previewPane.Size = _leftRightPreviewSize;
            _previewPane.Left = RightAutohideButtons.Left - _previewPane.Width;

            int y = e.ButtonLocation.Y;

            if (y < RightAutohideButtons.Top)
            {
                y = RightAutohideButtons.Top;
            }
            else if (y + _previewPane.Height > RightAutohideButtons.Bottom)
            {
                y = RightAutohideButtons.Bottom - _previewPane.Height;
            }

            _previewPane.Top = y;

            if (_previewPane.Renderer != null)
            {
                _previewPane.Renderer.SelectedForm = e.Form;
            }

            _previewPane.Visible = PreviewRenderer != null;
        }
Example #3
0
 private void Expression_OnPreview(object Sender, PreviewEventArgs e)
 {
     if (!(this.response?.HeaderSent ?? true))
     {
         this.previewing = true;
         this.SendResponse(e.Preview, true);
     }
 }
Example #4
0
        /// <summary>
        /// Occurs when mouse button was moved over a tab button
        /// </summary>
        /// <param name="buttonUnderMouse">button under mouse</param>
        protected override void OnMouseMoveOverTabButton(UnitButton buttonUnderMouse)
        {
            EventHandler <PreviewEventArgs> handler = ShowPreview;

            if (handler != null)
            {
                PreviewEventArgs args = new PreviewEventArgs(new Point(buttonUnderMouse.Left, buttonUnderMouse.Top),
                                                             (Form)buttonUnderMouse.Page);
                handler(this, args);
            }
        }
Example #5
0
 private async void HandlePreviewReady(Object source, PreviewEventArgs args)
 {
     if (DateTime.Now.Subtract(_lastSent) > TimeSpan.FromSeconds(1 / _fps))
     {
         try
         {
             await _client.SendToAsync(args.Data, IpAddress, Port);
         }
         catch (Exception ex)
         {
         }
     }
 }
Example #6
0
 void FrameAvailable(object sender, PreviewEventArgs e)
 {
     Element.RaisePreviewAvailable(e);
 }