Exemplo n.º 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();
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
 private void ReleasePosition(Position position)
 {
     position.IsOccupied = false;
     position.Id = String.Empty;
 }
Exemplo n.º 4
0
 private void OccupyPosition(Position position, string id)
 {
     position.Id = id;
     position.IsOccupied = true;
 }