Exemplo n.º 1
0
        /// <summary>
        /// Process when draw is finish
        /// </summary>
        /// <param name="obj">The object.</param>
        public void CreateObject(IDrawingObject obj)
        {
            IAction action = null;

            if (obj.GetObjectType() == DrawingObjectType.Shape)
            {
                action = new CreateShapeAction((ShapeBase)obj);
            }
            else if (obj.GetObjectType() == DrawingObjectType.Text)
            {
                var text = obj as TextObject;
                if (text != null)
                {
                    action = new UpdateTextControlAction()
                    {
                        Text     = "",
                        Font     = text.Font,
                        Location = text.Location
                    }
                }
                ;
            }

            SendAction(action);

            if (obj.GetObjectType() == DrawingObjectType.Text)
            {
                action = new CreateTextAction((TextObject)obj);
                SendAction(action);
            }

            _page.AddDrawingObject(obj);
        }
Exemplo n.º 2
0
        private void SendCreateTextAction(CreateTextAction action, NetworkStream stream)
        {
            // Location | Size | Text | Font | Color

            // Location
            WritePointF(action.Text.Location, stream);
            // Size
            WriteSizeF(action.Text.Size, stream);
            // Outline Color
            WriteString(action.Text.Text, stream);
            // Outline width
            WriteFont(action.Text.Font, stream);
            // Fill Color
            WriteColor(action.Text.Color, stream);
        }