Beispiel #1
0
        /// <summary>
        /// Handles the ActiveInteractionControllerChanged event of VisualTool object.
        /// </summary>
        private void VisualTool_ActiveInteractionControllerChanged(object sender, Vintasoft.Imaging.PropertyChangedEventArgs <IInteractionController> e)
        {
            OfficeDocumentVisualEditor visualEditor = null;

            if (e.NewValue != null)
            {
                visualEditor = CompositeInteractionController.FindInteractionController <OfficeDocumentVisualEditor>(e.NewValue);
            }
            VisualEditor = visualEditor;
        }
Beispiel #2
0
 /// <summary>
 /// Handles the FocusedTextSymbolChanged event of TextTool object.
 /// </summary>
 private void TextTool_FocusedTextSymbolChanged(object sender, Vintasoft.Imaging.PropertyChangedEventArgs <Vintasoft.Imaging.Text.TextRegionSymbol> e)
 {
     UpdateUI();
 }
Beispiel #3
0
        /// <summary>
        /// Handles the ActiveInteractionControllerChanged event of the VisualTool.
        /// </summary>
        private void VisualTool_ActiveInteractionControllerChanged(object sender, Vintasoft.Imaging.PropertyChangedEventArgs <IInteractionController> e)
        {
            // if interaction controller exists
            if (e.NewValue != null)
            {
                // find visual editor in current interaction controller
                VisualEditor = CompositeInteractionController.FindInteractionController <OfficeDocumentVisualEditor>(e.NewValue);
            }
            else
            {
                VisualEditor = null;
            }

            // if visual editor exists
            if (VisualEditor != null)
            {
                // set current OfficeDocumentInteractionController
                OfficeDocumentInteractionController = e.NewValue;
            }
            else
            {
                OfficeDocumentInteractionController = null;
            }

            // if visual editor is not found or disabled
            if (VisualEditor == null || !VisualEditor.IsEnabled)
            {
                // if this form is visible
                if (Visible)
                {
                    // hide this form
                    Hide();
                }
            }
            else
            {
                // if this form is not visible
                if (!Visible)
                {
                    try
                    {
                        // if owner form is specified
                        if (Owner != null)
                        {
                            // if owner form is moved
                            if (_ownerLastLocation != Owner.Location)
                            {
                                // reset location
                                _ownerLastLocation = Owner.Location;
                                int x = LocationOffsetFromOwnerForm.X;
                                if (x < 0)
                                {
                                    x += Owner.Size.Width - Size.Width;
                                }
                                int y = LocationOffsetFromOwnerForm.Y;
                                if (y < 0)
                                {
                                    y += Owner.Size.Height - Size.Height;
                                }
                                Location = new Point(Owner.Location.X + x, Owner.Location.Y + y);
                            }

                            // show form
                            Show();

                            // set focus to owner form
                            Owner.Focus();
                        }
                        else
                        {
                            // show form
                            Show();
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }