Esempio n. 1
0
 public VdBadge(System.IO.BinaryReader r, int owner, int shapeId, int argPtId) :
     base(owner, shapeId)
 {
     _argPtId  = argPtId;
     _endpoint = new ClientClusterable(shapeId, boundsProvider);
     init(DaoUtils.UserIdToColor(owner));
 }
Esempio n. 2
0
        public override void RemoveFocus()
        {
            base.RemoveFocus();

            line.Stroke = new SolidColorBrush(DaoUtils.UserIdToColor(_initialOwner));
            VdSegmentUtil.HideMarkers(selMarker1, selMarker2);
        }
Esempio n. 3
0
        public VdFreeForm(int shapeId, int owner) :
            base(owner, shapeId)
        {
            _clr = DaoUtils.UserIdToColor(owner);
            init();

            RemoveFocus();
        }
Esempio n. 4
0
 public VdBadge(double x, double y, int owner, int shapeId, int argPtId) :
     base(owner, shapeId)
 {
     _argPtId  = argPtId;
     _endpoint = new ClientClusterable(shapeId, boundsProvider);
     init(DaoUtils.UserIdToColor(owner));
     setBadgePos(x, y);
 }
Esempio n. 5
0
        public VdText(double x, double y, int owner, int shapeId) :
            base(owner, shapeId)
        {
            initText(DaoUtils.UserIdToColor(owner));

            HandleMove(x, y);

            RemoveFocus();
        }
Esempio n. 6
0
        private void FreeDrawingMode(bool doEnter)
        {
            if (doEnter)
            {
                _ink.IsHitTestVisible  = true;
                _inkPalette.Visibility = Visibility.Visible;
                _palette.Visibility    = Visibility.Hidden;

                //set drawing attributes of current palette owner
                var da = _ink.DefaultDrawingAttributes.Clone();
                da.Width  = 4;
                da.Height = 4;
                _inkPalette.OnDrawingStarted();
                da.Color = DaoUtils.UserIdToColor(_palette.GetOwnerId());
                _ink.DefaultDrawingAttributes = da;
            }
            else
            {
                _ink.IsHitTestVisible  = false;
                _inkPalette.Visibility = Visibility.Hidden;
                _palette.Visibility    = Visibility.Visible;
                _modeMgr.Mode          = ShapeInputMode.ManipulationExpected;

                //create free form shape if we have locally created strokes
                var ownColor = DaoUtils.UserIdToColor(_palette.GetOwnerId());

                //while we have been drawing, somebody else could draw and still hasn't finalized drawing, so ink canvas can contain
                //strokes from multiple authors
                var ownStrokes = _ink.Strokes.Where(st => st.DrawingAttributes.Color == ownColor);
                if (ownStrokes.Count() > 0)
                {
                    //don't take cursor for free draw
                    var freeFrmSh =
                        (VdFreeForm)_doc.BeginCreateShape(VdShapeType.FreeForm, 0, 0, false, DocTools.TAG_UNDEFINED);
                    freeFrmSh.locallyJustCreated = true; //enable one-time stroke send
                    var ownStrokeCollection = new StrokeCollection(ownStrokes);
                    freeFrmSh.extractGeomtry(ownStrokeCollection, ownStrokeCollection.GetBounds());

                    //but set focus
                    _doc.VolatileCtx.UnfocusAll();
                    freeFrmSh.SetFocus();

                    //send state update to other clients
                    SendSyncState(freeFrmSh);

                    //remove own strokes
                    var notOwnStrokes = _ink.Strokes.Where(st => st.DrawingAttributes.Color != ownColor);
                    _ink.Strokes = new StrokeCollection(notOwnStrokes);

                    TryEndHostCaption(freeFrmSh, CaptionType.FreeDraw);
                }

                //update ink on other clients
                sendLocalInk();
            }
        }
Esempio n. 7
0
 public VdSegment(Double x1, Double y1, Double x2, Double y2, int owner, int shapeId) :
     base(owner, shapeId)
 {
     initLine(DaoUtils.UserIdToColor(owner));
     line.X1 = x1;
     line.Y1 = y1;
     line.X2 = x2;
     line.Y2 = y2;
     RemoveFocus();
 }
Esempio n. 8
0
        public VdText(double x, double y, int owner, int shapeId, CleanupRequest cleanupRequest) :
            base(owner, shapeId)
        {
            initText(DaoUtils.UserIdToColor(owner));

            _cleanupRequest = cleanupRequest;

            HandleMove(x, y);

            RemoveFocus();
        }
Esempio n. 9
0
        //ctor for drawing
        public VdCluster(int owner, int shapeId,
                         VdDocument doc,
                         OnClusterUncluster onClusterUncluster,
                         OnClusterCleanup OnClusterCleanup) :
            base(owner, shapeId)
        {
            _doc = doc;

            _endpoint = new ClientCluster(shapeId, boundsProvider);

            _onClusterUncluster = onClusterUncluster;

            _OnClusterCleanup = OnClusterCleanup;

            init(DaoUtils.UserIdToColor(owner));
        }
Esempio n. 10
0
        public VdClusterLink(ClientLinkable end1, ClientLinkable end2,
                             int shapeId, int owner) :
            base(owner, shapeId)
        {
            _end1 = end1;
            _end2 = end2;

            initLine(DaoUtils.UserIdToColor(owner));

            //wait until actual size is set
            line.Dispatcher.BeginInvoke(new Action(() =>
            {
                NotifyLinkableMoved();
            }),
                                        System.Windows.Threading.DispatcherPriority.Background);

            RemoveFocus();
            updateUserCursor();
        }