Пример #1
0
        public void Show(Position pos)
        {
            if (!Application.Current.Dispatcher.CheckAccess())
            {
                var action = new Action<Position>(Show);
                Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, action);
                return;
            }

            lock (this)
            {
                AllowsTransparency = true;
                PopupAnimation = PopupAnimation.Slide;

                HorizontalOffset = pos.OffsetX;
                VerticalOffset = pos.OffsetY;

                IsOpen = true;
                StaysOpen = true;
            }

            RaiseIsActivatedEvent();
        }
Пример #2
0
        private Position ObtainAndAppendPosition()
        {
            var position = new Position();

            if (IsEmptyPositionQueue())
            {
                position = ObtainFirstNewPosition();
                Positions.Add(position);
            }
            else if (AllPositionsAreOccupied())
            {
                position = ObtainLastNewPosition();
                Positions.Add(position);
            }
            else if (ExistFreePosition())
                position = ObtainFirstFreePosition();

            return position;
        }
Пример #3
0
 private void ReleasePosition(Position position)
 {
     position.IsOccupied = false;
     position.Id = String.Empty;
 }
Пример #4
0
 private void OccupyPosition(Position position, string id)
 {
     position.Id = id;
     position.IsOccupied = true;
 }