예제 #1
0
        private void NCDrawByBrush(IConnector connection, ArgBrushObject arg)
        {
            BrushLineObject line = arg.Line;

            if (arg.PictureBoxID == 0)
            {
                line.Picture = _canvas.BackPicture;
            }
            _canvas.AddDrawObject(arg.PictureBoxID, line);
            AddCommandToSendClients(arg);
        }
예제 #2
0
        private void NCDrawByBrush(IConnector connection, ArgBrushObject arg)
        {
            if (arg == null)
            {
                return;
            }

            BrushLineObject line = arg.Line;

            if (arg.PictureBoxID == 0)
            {
                line.Picture = _canvas.BackPicture;
            }
            _canvas.AddDrawObject(arg.PictureBoxID, line);
        }
예제 #3
0
        private void SendDrawObject(DrawObject drObj)
        {
            if (drObj == null || drObj.Picture == null)
            {
                return;
            }

            long        picBoxID = drObj.Picture.UniqueID; //canvas
            ICommandArg arg      = null;

            if (drObj is BrushLineObject)
            {
                BrushLineObject line = drObj as BrushLineObject;
                arg = new ArgBrushObject(_netClient.ClientID, picBoxID, line);
            }
            else if (drObj is LineObject)
            {
                LineObject line = drObj as LineObject;
                arg = new ArgLineObject(_netClient.ClientID, picBoxID, line);
            }
            else if (drObj is RectObject)
            {
                RectObject rect = drObj as RectObject;
                arg = new ArgRectObject(_netClient.ClientID, picBoxID, rect);
            }
            else if (drObj is EllipseObject)
            {
                EllipseObject ellipse = drObj as EllipseObject;
                arg = new ArgEllipseObject(_netClient.ClientID, picBoxID, ellipse);
            }
            else if (drObj is MoveObject)
            {
                MoveObject move = drObj as MoveObject;
                arg = new ArgMoveObject(_netClient.ClientID, picBoxID, move);
            }
            else if (drObj is SelectorObject)
            {
                SelectorObject selector = drObj as SelectorObject;
                arg = new ArgSelectorCopyObject(_netClient.ClientID, picBoxID, selector);
            }

            if (arg != null && _netClient.Connector != null)
            {
                _netClient.Connector.SendCommand(arg);
            }
        }