Пример #1
0
        public void OnReceivedBadgeGeometry(UserCursor cursor, SharedView[] badges)
        {
            Dictionary<int, SharedView> argPointsDict = Serializers.ArrToDict(badges.Where(sv => sv.viewType));
            Dictionary<int, SharedView> groupDict = Serializers.ArrToDict(badges.Where(sv => !sv.viewType));

            Utils.EnumSVIs(unsolved, (ScatterViewItem svi) =>
            {
                bool viewType;
                int Id = SviContentToId(svi, out viewType);

                SharedView sv = null;
                if (viewType)
                {
                    if (argPointsDict.ContainsKey(Id))
                        sv = argPointsDict[Id];
                }
                else
                {
                    if (groupDict.ContainsKey(Id))
                        sv = groupDict[Id];
                }

                if (sv != null)
                {
                    svi.Center = new Point(sv.badgeGeometry.CenterX,
                                           sv.badgeGeometry.CenterY);
                    svi.Orientation = sv.badgeGeometry.Orientation;

                    SetUserCursor(svi, cursor);
                }
                else
                {
                    //hide previous cursors of the user 
                    HideUserCursor(svi, cursor.usrId);
                }
            });
        }
Пример #2
0
        public void notifyGeometryChanged(List<ScatterViewItem> updatedItems, bool withStruct, int activeTopicId)
        {
            var updatedBadges = new List<SharedView>();
            foreach (var svi in updatedItems)
            {
                bool viewType;
                int Id = SviContentToId(svi, out viewType);
                if (Id != -1)
                {
                    var sharedBadge = new SharedView(Id, viewType);
                    sharedBadge.badgeGeometry.CenterX = svi.Center.X;
                    sharedBadge.badgeGeometry.CenterY = svi.Center.Y;
                    sharedBadge.badgeGeometry.Orientation = svi.Orientation;
                    sharedBadge.viewType = viewType;
                    updatedBadges.Add(sharedBadge);
                }
            }

            userCursor.State = CursorInputState.Mouse;
            _sharedClient.clienRt.NotifyGeometryChanged(userCursor, updatedBadges.ToArray(), withStruct, activeTopicId);
        }