Exemplo n.º 1
0
 public void StartDisplay(TravelOffer lastTravel)
 {
     _currentOffer = lastTravel;
     try
     {
         InitializeComponent();
         InitList();
         var helper = KinectHelper.Instance;
         helper.ReadyEvent += (s, _) => HelperReady();
         GreenScreen.Start(helper.Sensor, false);
         SetNewHat();
         Accessories.Start(helper.Sensor);
         RectNavigationControl.Start(helper.Sensor);
         RectNavigationControl.SwipeLeftEvent += SwipeLeft;
         RectNavigationControl.SwipeRightEvent += SwipeRight;
         RectNavigationControl.SwipeUpEvent += SwipeUp;
         RectNavigationControl.SwipeDownEvent += SwipeDown;
         RectNavigationControl.NoSwipe += NoSwipe;
         string[] texts = MyTextLoopList.GetNeighbourTexts();
         RectNavigationControl.SetTopText(texts[0]);
         RectNavigationControl.SetBottomText(texts[1]);
         InitGenderDetection();
     }
     catch (Exception exc)
     {
         ExceptionTextBlock.Text = exc.Message + "\r\n" + exc.InnerException + "\r\n" + exc.StackTrace;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Writes the informations given by the object to the info banner screen
        /// </summary>
        /// <param name="offer">Offer which like to show</param>
        public void Start(TravelOffer offer)
        {
            char star = '\u2605';
            String bullet = Convert.ToString('\u2023');
            String euro = Convert.ToString('\u20AC');
            String ratingStars = "";

            for (int i = 0; i <= offer.HotelRating; i++)
            {
                ratingStars += Convert.ToString(star);
            }
            if (offer.Category.CategoryName == "Wandern")
                Category.Text = "Wanderurlaub";
            else
                Category.Text = offer.Category.CategoryName + "urlaub";
            Stars.Text = ratingStars;
            HotelName.Text = offer.HotelName;
            Place.Text = offer.Place;
            PricePerPerson.Text = offer.PricePerPerson + ",- "+ euro +"\npro Person";
            TravelInfo.Text = offer.DayCount + "-tägige " + offer.TravelType + "\ninkl. " + offer.BoardType;

            string extInfo = "";
            foreach (ExtendedInformation information in offer.ExtendedInformation)
                extInfo += (bullet + " " + information.Information + "\n");
            ExtendetInfo.Text = extInfo;

            //var iterator = offer.ExtendedInformation.GetEnumerator();
            ////ExtendetInfoImg1.Source = new BitmapImage(){ Source = new BitmapImage(new Uri(Directory.GetFiles(Environment.CurrentDirectory + @"\Images\Arrow.png").First(), UriKind.RelativeOrAbsolute)), Stretch = Stretch.Fill };
            //ExtendetInfo1.Text = (iterator.MoveNext()) ? iterator.Current.Information : "";
            //ExtendetInfo2.Text = (iterator.MoveNext()) ? iterator.Current.Information : "";
            //ExtendetInfo3.Text = (iterator.MoveNext()) ? iterator.Current.Information : "";
            //ExtendetInfo4.Text = (iterator.MoveNext()) ? iterator.Current.Information : "";
        }
Exemplo n.º 3
0
        public void SetSpashScreenOffer(TravelOffer offer)
        {
            char star = '\u2605';
            String bullet = Convert.ToString('\u2023');
            String euro = Convert.ToString('\u20AC');
            String ratingStars = "";
                if (offer != null)
                {
                    _currentOffer = offer;
                    if (_currentOffer.Category.CategoryName == "Wandern")
                        Category.Text = "Wanderurlaub";
                    else
                        Category.Text = _currentOffer.Category.CategoryName+"urlaub";

                    for (int i = 0; i <= _currentOffer.HotelRating; i++)
                    {
                        ratingStars += Convert.ToString(star);
                    }

                    Stars.Text = ratingStars;
                    HotelName.Text = _currentOffer.HotelName;
                    Place.Text = _currentOffer.Place;
                    PricePerPerson.Text = _currentOffer.PricePerPerson + ",- " + euro + "\npro Person";
                    TravelInfo.Text = _currentOffer.DayCount + "-tägige " + _currentOffer.TravelType + ", inkl. " + _currentOffer.BoardType;
                    string extInfo = "";
                    foreach (ExtendedInformation information in _currentOffer.ExtendedInformation)
                        extInfo += (bullet+ "  " + information.Information + "\n");
                    ExtendedInfo.Text = extInfo;
                }
        }
Exemplo n.º 4
0
        /*Wenn die LoopList vertical gescrollt wurde, wird die TextLoopList gescrollt.*/
        private void MyLoopListOnScrolled(object sender, EventArgs e)
        {
            if (e != null)
            {
                LoopListArgs lla = (LoopListArgs)e;

                if (lla.GetId() != -1) // Wenn Minigame
                {
                    GreenScreen.Opacity = 1;
                    Accessories.Opacity = 1;
                    MyTextLoopList.Opacity = 0.7;
                    _isGameActive = false;
                    _currentOffer = new TravelOfferDao().SelectById(lla.GetId());
                }
                else
                {
                    _isGameActive = true;
                    GreenScreen.Opacity = 0.2;
                    Accessories.Opacity = 0.2;
                    MyTextLoopList.Opacity = 0;
                }

                SetNewHat();

                switch (lla.GetDirection())
                {
                    case Direction.Top:
                        _waitForTextList = MyTextLoopList.Anim(true);
                        break;
                    case Direction.Down:
                        _waitForTextList = MyTextLoopList.Anim(false);
                        break;
                }
                ResetDragDirectionObvious();
                if (!_unclicked)
                    _doDrag = true;
            }
        }
Exemplo n.º 5
0
        private void CreateTravelOffer(int i)
        {
            string[] travelType = {"Flugzeug", "Boot", "Busfahrt"};

            var offer = new TravelOffer()
                            {
                                BoardType = GetRandomBool() ? "Vollpension" : "Halbpension",
                                DayCount = GetRandomInteger(1, 14),
                                HotelName = "Hotel " + i,
                                Place = "Place " + 1,
                                PricePerPerson = GetRandomInteger(50, 1000),
                                TravelType = travelType[GetRandomInteger(0, travelType.Count() - 1)],
                                HotelRating = GetRandomInteger(1,5),
                                CategoryId = GetRandomInteger(1, _context.CategorySet.Count()),
                                TopOffer = (GetRandomInteger(1,4) == 4),
                                ImgPath = "imagepath",
                            };

            var count = GetRandomInteger(0, 4);
            for (int j = 0; j < count; j++)
            {
                offer.ExtendedInformation.Add(CreateExtendedInfo(j));
            }
            _context.TravelOfferSet.Add(offer);
        }
Exemplo n.º 6
0
 public void StartDisplay(Database.TravelOffer lastTravel)
 {
     SetSpashScreenOffer(lastTravel);
 }
Exemplo n.º 7
0
 public void StartDisplay(Database.TravelOffer lastTravel)
 {
     _currentOffer = lastTravel;
     PaintImage(_currentOffer.ImgPath);
     StartGreenScreenAndHat();
 }