// get information about a current floating object
        public static string GetInformationAboutCurrentFloatingObject(FloatingObjectAnchorBox currentObjectAnchor, DocumentLayout currentLayout)
        {
            LayoutFloatingObject currentFloatingObject = currentObjectAnchor.FloatingObjectBox;
            string returnedInformation = "";

            if (currentFloatingObject.Type == LayoutType.FloatingPicture)
            {
                returnedInformation = "!A FLOATING PICTURE IS SELECTED!\r\n";
            }
            else if (currentFloatingObject.Type == LayoutType.TextBox)
            {
                returnedInformation = "!A TEXT BOX IS SELECTED!\r\n";
            }

            returnedInformation += String.Format("Anchor location: {0}\r\n", currentObjectAnchor.Bounds.Location);
            returnedInformation += String.Format("Object bounds: {0}\r\n", currentFloatingObject.Bounds);
            returnedInformation += String.Format("Rotation: {0}\r\n", currentFloatingObject.RotationAngle);

            if (currentFloatingObject.Type == LayoutType.TextBox)
            {
                LayoutTextBox currentTextBox = currentFloatingObject as LayoutTextBox;
                returnedInformation += String.Format("\r\n!!Content information:\r\n");
                returnedInformation += TextBoxLayoutHelper.GetInformationAboutCurrentTextBoxContent(currentTextBox, currentLayout);
            }
            else if (currentFloatingObject.Type == LayoutType.FloatingPicture)
            {
                LayoutFloatingPicture currentFloatingPicture = currentFloatingObject as LayoutFloatingPicture;
                returnedInformation += String.Format("\r\n!!Image properties:\r\n");
                returnedInformation += GetInformationAboutOfficeImage(currentFloatingPicture.Image);
            }

            return(returnedInformation);
        }
 public override void DrawFloatingPicture(LayoutFloatingPicture floatingPicture)
 {
     if (Form1.customDrawImage == true)
     {
         Rectangle   bounds     = floatingPicture.Bounds;
         Point       startPoint = new Point(bounds.X + Canvas.ConvertToDrawingLayoutUnits(10, DocumentLayoutUnit.Pixel), bounds.Y + bounds.Height - Canvas.ConvertToDrawingLayoutUnits(40, DocumentLayoutUnit.Pixel));
         RichEditPen pEn        = new RichEditPen(Color.Coral);
         pEn.Thickness = 30;
         pEn.DashStyle = RichEditDashStyle.Dash;
         Canvas.DrawEllipse(pEn, bounds);
         Canvas.DrawString("Approved", new Font("Courier New", 26), new RichEditBrush(Color.DarkMagenta), startPoint);
     }
     else
     {
         base.DrawFloatingPicture(floatingPicture);
     }
 }
 public override void DrawFloatingPicture(LayoutFloatingPicture floatingPicture)
 {
     if (MainWindow.customDrawPicture == true)
     {
         Rectangle bounds     = floatingPicture.Bounds;
         Point     startPoint = new Point(bounds.X + Canvas.ConvertToDrawingLayoutUnits(10, DocumentLayoutUnit.Pixel), bounds.Y + bounds.Height -
                                          Canvas.ConvertToDrawingLayoutUnits(40, DocumentLayoutUnit.Pixel));
         RichEditPen pEn = new RichEditPen(System.Windows.Media.Color.FromRgb(220, 20, 60));
         pEn.Thickness = 30;
         pEn.DashStyle = RichEditDashStyle.Dash;
         Canvas.DrawEllipse(pEn, bounds);
         Canvas.DrawString("Approved", new Font("Courier New", 26), new RichEditBrush(System.Windows.Media.Color.FromRgb(139, 0, 139)), startPoint);
     }
     else
     {
         base.DrawFloatingPicture(floatingPicture);
     }
 }
 protected override void VisitFloatingPicture(LayoutFloatingPicture floatingPicture)
 {
     TryAddElementToCollection(floatingPicture, ContentDisplayAction.ScrollTo, false);
     base.VisitFloatingPicture(floatingPicture);
 }
 public override void DrawFloatingPicture(LayoutFloatingPicture floatingPicture)
 {
     base.DrawFloatingPicture(floatingPicture);
     HighlightElement(floatingPicture);
 }
 protected override void VisitFloatingPicture(LayoutFloatingPicture floatingPicture)
 {
     AddTreeNode(floatingPicture, ContentDisplayAction.ScrollTo);
     base.VisitFloatingPicture(floatingPicture);
 }