public void OnDungeonSelected(object sender, GestureEventArgs e)
        {
            var selectedGrid = sender as Grid;
            var dungeonId = (int)selectedGrid.Tag;
            _selectedDungeon = GetDungeon(dungeonId);

            var heroRepository = new HeroRepository();
            _heroesOwnedByPlayer = heroRepository.GetHeroesOwnedByPlayer().Count;

            var playerRepository = new PlayerRepository();
            _player = playerRepository.GetPlayer();

            if (PlayerCanEnterDungeon())
            {
                _player.Stam.Current = _player.Stam.Current - _selectedDungeon.StaminaCost;
                playerRepository.SavePlayer(_player);
                MessageBus.Default.Notify("EnterDungeon", new Object(), new NotificationEventArgs(dungeonId.ToString()));
            }
            else
            {
                var errorModalControl = GetErrorMessage();
                var errorModal = new ModalContainer(errorModalControl);
                errorModal.Show();
            }
        }
Ejemplo n.º 2
0
 private void LayoutRootTap(object sender, GestureEventArgs e)
 {
     if (TapAvatar != null)
     {
         TapAvatar(tbUserName.Text);
     }
 }
Ejemplo n.º 3
0
        private void Click(object sender, GestureEventArgs gestureEventArgs)
        {
            object obj = ((FrameworkElement) sender).DataContext;

            DirectoryItem directoryItem = obj as DirectoryItem;
            if (directoryItem != null)
            {
                // Navigate into that directoryitem
                string path = string.Empty;
                if (NavigationContext.QueryString.ContainsKey("Path"))
                    path = NavigationContext.QueryString["Path"] + "/";
                path += (directoryItem).Name;

                NavigationService.Navigate(new Uri("/Wall.xaml?Structure=Folders&Path=" + path, UriKind.Relative));
                return;
            }

            FavList favList = obj as FavList;
            if (favList != null)
            {
                NavigationService.Navigate(new Uri("/Wall.xaml?Structure=Favs&Path=" + favList.Name, UriKind.Relative));
                return;
            }

            Game game = obj as Game;
            if (game == null) return;

            NavigationService.Navigate(new Uri("/GameInfo.xaml?id=" + game.ID, UriKind.Relative));
        }
Ejemplo n.º 4
0
        private void image_Tap(object sender, GestureEventArgs e)
        {
            Ellipse temp = (Ellipse)sender;
            string txt = temp.Name;
            int x = int.Parse(txt.Substring(5, txt.LastIndexOf("_") - 5));
            int y = int.Parse(txt.Substring(txt.LastIndexOf("_") + 1, txt.Length - txt.LastIndexOf("_") - 1));
            txtStatus.Text = x.ToString() + " " + y.ToString();

            if (gamefield[x, y] == 0)
            {
                if (n % 2 == 0)
                {
                    SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 48, 48, 48));
                    temp.Fill = brush;
                    gamefield[x, y] = 1;
                }
                else
                {
                    SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 220, 220, 220));
                    temp.Fill = brush;
                    gamefield[x, y] = 2;
                }
                n++;
            }
        }
Ejemplo n.º 5
0
        public void AddEventItem(object sender, GestureEventArgs e)
        {
            Grid grid = sender as Grid;
            Point point = e.GetPosition(grid);

            string eventTitle = " + New title event";
            double width = (grid.Parent as ScrollViewer).Width - 50;

            DateTime dateTime = _lastItem.ItemDate;
            int hour = (int)Math.Ceiling((point.Y) / Constants.GRID_HOURS_CELL_HEIGHT);
            EventItem eventItem = new EventItem()
               {
                   EventColor = CustomColor.CornflowerBlue,
                   EventStart = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, hour, 0, 0),
                   EventEnd = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, hour + 1, 0, 0),
                   EventTitle = eventTitle,
                   EventLocation = string.Empty
               };

            DailyDetailItem eventDetails = new DailyDetailItem(eventItem);
            eventDetails.Click += EditEvent;

            _lastItem.EventsForDay.Add(eventItem);

            eventDetails.SetValue(Grid.RowProperty, hour);
            eventDetails.SetValue(Grid.RowSpanProperty, 1);
            eventDetails.SetValue(Grid.ColumnProperty, 1);
            grid.Children.Add(eventDetails);
        }
Ejemplo n.º 6
0
 private void OnControlTap(object sender, GestureEventArgs e)
 {
     if (AudioState == AudioState.Playing)
         QuranApp.NativeProvider.AudioProvider.Pause();
     else if (AudioState == AudioState.Paused)
         QuranApp.NativeProvider.AudioProvider.Play();
 }
Ejemplo n.º 7
0
        private void Click(object sender, GestureEventArgs e)
        {
            Game game = (Game) ((FrameworkElement) sender).DataContext;
            if (game == null) return;

            NavigationService.Navigate(new Uri("/GameInfo.xaml?id=" + game.ID, UriKind.Relative));
        }
        private void OnTap(object sender, GestureEventArgs e)
        {
            if (Command == null)
                return;

            Command.Execute(CommandParameter);
        }
Ejemplo n.º 9
0
 private void Image_Tap(object sender, GestureEventArgs e)
 {
     var file = (RingtoneListItem)((Image)sender).DataContext;
     if (file != null && !file.DisplayName.Contains("none"))
     {
     #if ARM
         string fileName = Path.GetFileName(file.FullPath);
         try
         {
             // Copy file to the isf
             if (!_isoStore.FileExists(fileName))
             {
                 SystemTray.ProgressIndicator.IsVisible = true;
                 File.Copy(file.FullPath, Path.Combine(_isoRootPath, fileName), true);
             }
             using (IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream(fileName, FileMode.Open, _isoStore))
             {
                 mediaElement.SetSource(isoStream);
                 mediaElement.Play();
                 SystemTray.ProgressIndicator.IsVisible = false;
             }
         }
         catch { }
     #else
         MessageBox.Show(file.FullPath);
     #endif
     }
 }
Ejemplo n.º 10
0
        private void RequestSMSButton_Tap(object sender, GestureEventArgs e)
        {
            GlobalIndicator.Instance.IsLoading = true;

            // Call sign up method again with filled additional parameter SID.
            _DoSignUp();
        }
Ejemplo n.º 11
0
 private void OnTap(object sender, GestureEventArgs e)
 {
     if (TapCommand != null)
     {
         TapCommand.Execute(CommandParameter);
     }
 }
Ejemplo n.º 12
0
 private void xItemBorder_Tap(object sender, GestureEventArgs e)
 {
     //Border border = sender as Border;
     //ChannelInfo channelInfo = border.Tag as ChannelInfo;
     //if (ItemTap != null)
     //    ItemTap(sender, channelInfo.VID);
 }
Ejemplo n.º 13
0
 private void SearchLogo_Tap(object sender, GestureEventArgs e)
 {
     if (InputText != null && SearchBox.Text.Length > 0)
     {
         InputText(this, SearchBox.Text);
     }
 }
Ejemplo n.º 14
0
        async void lstFriends_Tap(object sender, GestureEventArgs e)
        {
            if (lstFriends.SelectedItem != null)
            {
                
                FacebookUser selectedFriend = lstFriends.SelectedItem as FacebookUser;
                Permission permission = new Permission();

                MessageBoxResult result = MessageBox.Show(
                    string.Format(AppResources.FriendAddView_Txt_FriendAddQuestion,selectedFriend.Name),
                    AppResources.FriendAddView_Txt_FriendAddTitle,
                    MessageBoxButton.OKCancel);

                if (result == MessageBoxResult.OK)
                {
                    permission.FBIDFromViewed = selectedFriend.Id;
                    permission.FBIDFromViewer = App.fbUserID;
                    permission.IsAllowed = false;
                    permission.PartitionKey = permission.FBIDFromViewer;
                    permission.RowKey = permission.FBIDFromViewed;
                    
                    bool addResult = await (this.DataContext as FriendAddViewModel).TryAddNewFriend(permission);
                    if (addResult)
                        MessageBox.Show(AppResources.FriendAddView_Txt_FriendAddSuccess,AppResources.FriendAddView_Txt_FriendAddTitle, MessageBoxButton.OK);
                    else MessageBox.Show(AppResources.FriendAddView_Txt_FriendAddError, AppResources.FriendAddView_Txt_FriendAddTitle, MessageBoxButton.OK);
                }   
            }
        }
Ejemplo n.º 15
0
        private void HoldGesture(object sender, GestureEventArgs e)
        {
            if (!IsEnabled)
                return;

            IsActive = true;

            _cardView = sender as CardView;
            if (_cardView == null)
            {
                IsActive = false;
            }
            else
            {
                var selected = (CardViewModel)_cardView.DataContext;

                var scrollOffset = new Point(_scrollViewer.HorizontalOffset, _scrollViewer.VerticalOffset);
                _originalRelativePosition = _cardView.GetRelativePositionIn(_context, scrollOffset);

                // Fade everything out
                //if (_context != null)
                //    _context.Animate(1.0, 0.7, UIElement.OpacityProperty, 300, 0);

                if (_context != null)
                    FadeCards(_context, selected);

                // Popout the selected card
                // PopoutCard(_cardView, _draggedImage, _originalRelativePosition, scrollOffset);

                // We can allow children to listen to events now
                EnableChildInteractions();
            }
        }
Ejemplo n.º 16
0
        protected override void OnTap(GestureEventArgs e)
        {
            base.OnTap(e);

            App.HNavigation.GoToQuizPage();
            App.User = user;
        }
Ejemplo n.º 17
0
    public void ModifyCreation(GestureEventArgs e)
    {
        var gesture = e.Sender as IPositionGesture;

        if (gesture != null)
        {
            var pos = gesture.GetGesturePosition(Hand.Both);
            CreatedInstance.transform.position = pos;
            lastGesturePositions.Add(pos);

            while (lastGesturePositions.Count > 5)
            {
                lastGesturePositions.RemoveAt(0);
            }

            var scale = GetScale(gesture);
            CreatedInstance.transform.localScale = scale;

            var rotation = GetRotation(gesture);
            CreatedInstance.transform.rotation = rotation;

            var rigidbody = CreatedInstance.GetComponent<Rigidbody>();
            rigidbody.mass = GetMass(scale);
        }
    }
Ejemplo n.º 18
0
 private void textBox_name_Tap(object sender, GestureEventArgs e)
 {
     if (defaultMessage)
     {
         textBox_name.Text = "";
         defaultMessage = false;
     }
 }
Ejemplo n.º 19
0
 private void OnAllowWideIconicTileChanged(object sender, GestureEventArgs e)
 {
   if (IconicTemplate.Exists(MainPageUri))
   {
     IconicTemplate.Remove(MainPageUri);
     ToggleIconicTile.IsChecked = false;
   }
 }
        private void SelectWholeText(object sender,
                                            GestureEventArgs e)
        {
            var textBox = sender as LabeledWaternarkTextBox;
            SetNormalStyle();

            textBox.InhaltsText.SelectAll();
        }
Ejemplo n.º 21
0
 protected override void OnHold(GestureEventArgs e)
 {
     base.OnHold(e);
     //if (this.Action != null)
     //{
     //    this.Action.OnHold(e);
     //}
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 选择了表情
 /// </summary>
 private void StackPanel_Tap(object sender, GestureEventArgs e)
 {
     StackPanel sp = sender as StackPanel;
     if ( sp. Tag != null )
     {
         EventSingleton. Instance. RaiseNewFace( sp. Tag. ToString( ) );
     }
 }
Ejemplo n.º 23
0
 private void OnTagTapped(object sender, GestureEventArgs e)
 {
     string text = ((Button)sender).DataContext as string;
     TagTapped(this, new TagTappedEvenArgs()
     {
         Tag = text
     });
 }
Ejemplo n.º 24
0
 private void OnAllowWideFlipTileChanged(object sender, GestureEventArgs gestureEventArgs)
 {
   if (FlipTemplate.Exists(MainPageUri))
   {
     FlipTemplate.Remove(MainPageUri);
     ToggleFlipTile.IsChecked = false;
   }
 }
Ejemplo n.º 25
0
        private void EventsName_OnTap(object sender, GestureEventArgs e)
        {
            var listBox = ((ListBox)sender);
            var eventSummaryViewModel = (EventSummaryViewModel)listBox.SelectedItems[0];
            eventSummaryViewModel.GoToEventCommand.Execute(sender);

            _ClearListItemAfterItHasBeenClicked(listBox);
        }
Ejemplo n.º 26
0
        private void SignUpButton_Tap(object sender, GestureEventArgs e)
        {
            string phone = LoginTextBox.Text;

            if (!_ShowValidationErrors())
            {
                _CheckPhone(phone);
            }
        }
Ejemplo n.º 27
0
    public void UpdateDrawing(GestureEventArgs e)
    {
        var gesture = e.Sender as IPositionGesture;

        if (gesture != null)
        {
            _positions.Add(gesture.GetGesturePosition(Hand.Either));
        }
    }
Ejemplo n.º 28
0
        private void text_box_Tap(object sender, GestureEventArgs e)
        {

            if (FirstTime)
            {
                text_box.Select(0, 0);
                FirstTime = false;
            }
        }
 public void OnSelectHero(object sender, GestureEventArgs e)
 {
     var target = sender as Grid;
     if (target.Tag != null)
     {
         var targetId = target.Tag.ToString();
         MessageBus.Default.Notify("ShowHeroDetails", new Object(), new NotificationEventArgs(targetId));
     }
 }
Ejemplo n.º 30
0
 public override void Tap(GestureEventArgs e)
 {
     base.Tap(e);
     Pushpin pushpin = new Pushpin();
     Point2D point = _map.ScreenToMap(e.GetPosition(_map));
     pushpin.Location = point;
     _eLayer.AddChild(pushpin);
     _pushpins.Add(pushpin);
 }
Ejemplo n.º 31
0
 private void Thickness_OnTap(object sender, GestureEventArgs e)
 {
     this.SelectThickness(((FrameworkElement)sender).DataContext as BrushThicknessViewModel);
 }
Ejemplo n.º 32
0
        private void TouchpadOnGesture(object sender, GestureEventArgs e)
        {
            var msg = string.Format("{0}: Param={1}, XYZ: ({2}, {3}, {4})", e.GestureTypes, e.Parameter, e.X, e.Y, e.Z);

            LogGesture(msg);
        }
Ejemplo n.º 33
0
        private void AppointmentResultsData_Tap(object sender, GestureEventArgs e)
        {
            App.appt = ((sender as ListBox).SelectedValue as Appointment);

            NavigationService.Navigate(new Uri("/AppointmentDetails.xaml", UriKind.Relative));
        }
Ejemplo n.º 34
0
 private void ShowRequests_Tap(object sender, GestureEventArgs e)
 {
     NavigationService.Navigate(new Uri("/Views/FriendRequestsPage.xaml", UriKind.Relative));
 }
Ejemplo n.º 35
0
        void WrapPanelSample_Tap(object sender, GestureEventArgs e)
        {
            Border b = (Border)sender;

            wrapPanel.Children.Remove(b);
        }
Ejemplo n.º 36
0
        private void RatingImageIcon_Tap(object sender, GestureEventArgs e)
        {
            MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();

            marketplaceReviewTask.Show();
        }
Ejemplo n.º 37
0
 private void Button_14_Tap(object sender, GestureEventArgs e)
 {
     _id = _listaId[13];
     this.NavigationService.Navigate(new Uri("/AttractionData.xaml", UriKind.RelativeOrAbsolute));
 }
Ejemplo n.º 38
0
        private static void P1Steered(object sender, GestureEventArgs e)
        {
            var direction = ((SteeringGestureEventArgs)e).Direction;

            Console.Write("P1 steering " + direction + " ");
            if (direction < 0)
            {
                if (rightdown)
                {
                    DirectInput.KeyUp(DirectInput.VK_RIGHT);
                    rightdown = false;
                }
                if (direction == -2)
                {
                    if (!spacedown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_SPACE);
                        spacedown = true;
                    }
                }
                else
                {
                    if (!leftdown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_LEFT);
                        leftdown = true;
                    }
                    if (spacedown)
                    {
                        DirectInput.KeyUp(DirectInput.VK_SPACE);
                        spacedown = false;
                    }
                }
            }
            else if (direction > 0)
            {
                if (leftdown)
                {
                    DirectInput.KeyUp(DirectInput.VK_LEFT);
                    leftdown = false;
                }
                if (direction == 2)
                {
                    if (!spacedown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_SPACE);
                        spacedown = true;
                    }
                }
                else
                {
                    if (!rightdown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_RIGHT);
                        rightdown = true;
                    }
                    if (spacedown)
                    {
                        DirectInput.KeyUp(DirectInput.VK_SPACE);
                        spacedown = false;
                    }
                }
                //Keyboard.SendKeyAsInput(Keys.Right);
            }
            else
            {
                if (leftdown)
                {
                    DirectInput.KeyUp(DirectInput.VK_LEFT);
                    leftdown = false;
                }
                if (rightdown)
                {
                    DirectInput.KeyUp(DirectInput.VK_RIGHT);
                    rightdown = false;
                }
                if (spacedown)
                {
                    DirectInput.KeyUp(DirectInput.VK_SPACE);
                    spacedown = false;
                }
            }
        }
Ejemplo n.º 39
0
 private void BtnPlay_OnTap(object sender, GestureEventArgs e)
 {
     NavigationService.Navigate(new Uri("/PlayPage.xaml", UriKind.Relative));
 }
Ejemplo n.º 40
0
    /*
     * public void onGestureDetectedProgress(float progress)
     * {
     *  print("gesture progress detected!!");
     *  digScript.gestureprogress = progress;
     * }
     */

    #region 測試姿勢有沒有符合
    void OnGestureDetected(object sender, GestureEventArgs e, int bodyIndex)
    {
        //  print("comehere");
        var isDetected = e.IsBodyTrackingIdValid && e.IsGestureDetected;

        //  print("gesturedetected is" + bodyIndex);
        //print("id is " + e.GestureID);
        //if (e.DetectionConfidence > 0.5f)
        //{
        ConfidenceTextGameObject.text = "confidence is " + e.DetectionConfidence + "id is " + e.GestureID;
        //}


        if (e.GestureID == RainName)
        {
            //    print("inside Rain");

            if (e.DetectionConfidence > 0.50f)
            {
                seedScript.RRain = true;
            }
            else
            {
                seedScript.RRain = false;
            }
        }

        if (e.GestureID == DigName)
        {
            //    print("inside Dig");

            if (e.DetectionConfidence > 0.60f)
            {
                seedScript.DDigging = true;
            }
            else
            {
                seedScript.DDigging = false;
            }
        }


        if (e.GestureID == SeedName)
        {
            //     print("inside seed");


            if (e.DetectionConfidence > 0.50f)
            {
                seedScript.SSeed = true;
            }
            else
            {
                seedScript.SSeed = false;
            }
        }

        if (e.GestureID == PutName)
        {
            //    print("inside put");

            if (e.DetectionConfidence > 0.50f)
            {
                seedScript.PPut = true;
            }
            else
            {
                seedScript.PPut = false;
            }
        }

        /*
         * if (e.GestureID == "Bridge")
         * {
         *  //NEW UI FOR GESTURE DETECTed
         *  //GestureTextGameObject.text = "Gesture Detected: " + e.GestureID;
         *  //StringBuilder text = new StringBuilder(string.Format("Gesture Detected? {0}\n", isDetected));
         *  ConfidenceTextGameObject.text = "Confidence: " + e.DetectionConfidence;
         *  //text.Append(string.Format("Confidence: {0}\n", e.DetectionConfidence));
         *
         *  print("Bridge");
         *  //print("detectionconfidence" + e.DetectionConfidence + "gesturedetected is" + bodyIndex);
         *  //print("gesturedetected is" + bodyIndex);
         *  //print(this.gestureprogress);
         *  if (e.DetectionConfidence > 0.40f)
         *  {
         *      seedScript.RRain = true;
         *  }
         *  else
         *  {
         *      seedScript.RRain = false;
         *  }
         * }
         */

        //if (e.GestureID == BridgeDownName)
        //{

        //    print("Bridge_Down");
        //    print(e.DetectionConfidence);

        //    if (e.DetectionConfidence > 0.30f)
        //    {
        //        seedScript.RRain = true;
        //    }
        //    else
        //    {
        //        seedScript.RRain = false;
        //    }
        //}

        /*
         * if (e.GestureID == LiftHandName)
         * {
         *  //NEW UI FOR GESTURE DETECTed
         *  GestureTextGameObject.text = "Gesture Detected: " + e.GestureID;
         *  //StringBuilder text = new StringBuilder(string.Format("Gesture Detected? {0}\n", isDetected));
         *  ConfidenceTextGameObject.text = "Confidence: " + e.DetectionConfidence;
         *  //text.Append(string.Format("Confidence: {0}\n", e.DetectionConfidence));
         *
         *  print("lifthand");
         *  print(e.DetectionConfidence);
         *  //turnScript.lift = true;
         *  if (e.DetectionConfidence > 0.50f)
         *  {
         *      //turnScript.turnLeft = true;
         *      digScript.dig_true = true;
         *      print("dig_true change");
         *  }
         *  else
         *  {
         *      //turnScript.turnLeft = false;
         *      digScript.dig_true = false;
         *      print("dosen't bigger than");
         *  }
         *
         * //print("lefthandoutout");
         * }
         */
        /*if (e.GestureID == leanLeftGestureName)
         * {
         *  //NEW UI FOR GESTURE DETECTed
         *  GestureTextGameObject.text = "Gesture Detected: " + e.GestureID;
         *  //StringBuilder text = new StringBuilder(string.Format("Gesture Detected? {0}\n", isDetected));
         *  ConfidenceTextGameObject.text = "Confidence: " + e.DetectionConfidence;
         *  //text.Append(string.Format("Confidence: {0}\n", e.DetectionConfidence));
         *
         *  print("lean_left_gest");
         *  print(e.DetectionConfidence);
         *  if (e.DetectionConfidence > 0.65f)
         *  {
         *      print("haha");
         *      turnScript.turnLeft = true;
         *  }
         *  else
         *  {
         *      turnScript.turnLeft = false;
         *  }
         * }//end if lean_left_gest
         */


        //this.bodyText[bodyIndex] = text.ToString();
    }
Ejemplo n.º 41
0
 /// <summary>
 /// Handles the TouchPressed event of the gestures control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="GestureEventArgs" /> instance containing the event data.</param>
 private void Gestures_TouchPressed(object sender, GestureEventArgs e)
 {
     this.IsFocus = true;
     this.Animation.BeginAnimation(Transform2D.OpacityProperty, this.fadeOut);
 }
Ejemplo n.º 42
0
 /// <summary>
 /// Handles the TouchReleased event of the gestures control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="GestureEventArgs" /> instance containing the event data.</param>
 private void Gestures_TouchReleased(object sender, GestureEventArgs e)
 {
     this.Animation.BeginAnimation(Transform2D.OpacityProperty, this.fadeIn);
 }
Ejemplo n.º 43
0
 private async void UIElement_OnTap(object sender, GestureEventArgs e)
 {
     //zune:search?publisher=[publisher name]
     await Launcher.LaunchUriAsync(new Uri("zune:search?publisher=Jan Joris"));
 }
Ejemplo n.º 44
0
 void HandleButtonTap(object sender, GestureEventArgs e)
 {
     ((IButtonController)Element)?.SendReleased();
     ((IButtonController)Element)?.SendClicked();
 }
Ejemplo n.º 45
0
 private void DialogsPageTitle_Tap(object sender, GestureEventArgs e)
 {
     NavigationService.Navigate(new Uri("/Views/DialogsPage.xaml", UriKind.Relative));
 }
Ejemplo n.º 46
0
        private static void P2Steered(object sender, GestureEventArgs e)
        {
            var direction = ((SteeringGestureEventArgs)e).Direction;

            Console.WriteLine("P2 steering " + direction + " ");
            if (direction < 0)
            {
                if (ddown)
                {
                    DirectInput.KeyUp(DirectInput.VK_D);
                    ddown = false;
                }
                if (direction == -2)
                {
                    if (!xdown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_X);
                        xdown = true;
                    }
                }
                else
                {
                    if (!adown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_A);
                        adown = true;
                    }
                    if (xdown)
                    {
                        DirectInput.KeyUp(DirectInput.VK_X);
                        xdown = false;
                    }
                }
            }
            else if (direction > 0)
            {
                if (adown)
                {
                    DirectInput.KeyUp(DirectInput.VK_A);
                    adown = false;
                }
                if (direction == 2)
                {
                    if (!xdown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_X);
                        xdown = true;
                    }
                }
                else
                {
                    if (!ddown)
                    {
                        DirectInput.KeyDown(DirectInput.VK_D);
                        ddown = true;
                    }
                    if (xdown)
                    {
                        DirectInput.KeyUp(DirectInput.VK_X);
                        xdown = false;
                    }
                }
                //Keyboard.SendKeyAsInput(Keys.Right);
            }
            else
            {
                if (adown)
                {
                    DirectInput.KeyUp(DirectInput.VK_A);
                    adown = false;
                }
                if (ddown)
                {
                    DirectInput.KeyUp(DirectInput.VK_D);
                    ddown = false;
                }
                if (xdown)
                {
                    DirectInput.KeyUp(DirectInput.VK_X);
                    xdown = false;
                }
            }
        }
Ejemplo n.º 47
0
 private void InfoImageIcon_Tap(object sender, GestureEventArgs e)
 {
     NavigationService.Navigate(new Uri("/InfoPage.xaml", UriKind.Relative));
 }
Ejemplo n.º 48
0
 private void OnTapped(object sender, GestureEventArgs e)
 {
     this.VM.HandleTap();
 }
Ejemplo n.º 49
0
 private void OnMegaHeaderLogoTapped(object sender, GestureEventArgs e)
 {
     DebugService.ChangeStatusAction();
 }
Ejemplo n.º 50
0
 private void SelectedValueTextBlock_Tap(object sender, GestureEventArgs e)
 {
     Popup.IsOpen = !Popup.IsOpen;
 }
Ejemplo n.º 51
0
 private void Image_Tap(object sender, GestureEventArgs e)
 {
     NavigationService.Navigate(new Uri(@"/Views/SettingsPage.xaml", UriKind.Relative));
 }
Ejemplo n.º 52
0
        private void ContactResultsData_Tap(object sender, GestureEventArgs e)
        {
            App.con = ((sender as ListBox).SelectedValue as Contact);

            NavigationService.Navigate(new Uri("/ContactDetails.xaml", UriKind.Relative));
        }
Ejemplo n.º 53
0
 private void Changelog_Tap(object sender, GestureEventArgs e)
 {
     Navigate(typeof(ChangelogPage));
 }
Ejemplo n.º 54
0
 private void MainItemGrid_OnHold(object sender, GestureEventArgs e)
 {
     ViewModel.ClearSearchHistory();
 }
Ejemplo n.º 55
0
        private void TrialBorder_Tap(object sender, GestureEventArgs e)
        {
            MarketplaceDetailTask marketPlace = new MarketplaceDetailTask();

            marketPlace.Show();
        }
Ejemplo n.º 56
0
 private void View_OnTap(object sender, GestureEventArgs gestureEventArgs)
 {
     EventAggregator.Current.Publish(new StickersTapEvent((long)this._sticker.product_id, (int)this._sticker.id));
 }
Ejemplo n.º 57
0
 private void StackPanel_Tap_1(object sender, GestureEventArgs e)
 {
     this.NavigationService.Navigate(new Uri("/CatchTheName.xaml", UriKind.RelativeOrAbsolute));
 }
Ejemplo n.º 58
0
 private void StackPanel_Tap_2(object sender, GestureEventArgs e)
 {
     MessageBox.Show("We will working on it soon", "Information", MessageBoxButton.OK);
 }
Ejemplo n.º 59
0
 public void EndDrawing(GestureEventArgs e)
 {
 }
Ejemplo n.º 60
0
        private async void VideoCanvasOnTap(object sender, GestureEventArgs e)
        {
            try
            {
                System.Windows.Point uiTapPoint = e.GetPosition(VideoCanvas);

                if (PhotoCaptureDevice.IsFocusRegionSupported(PhotoCaptureDevice.SensorLocation) && _focusSemaphore.WaitOne(0))
                {
                    // Get tap coordinates as a foundation point
                    var tapPoint = new Windows.Foundation.Point(uiTapPoint.X, uiTapPoint.Y);

                    double xRatio = VideoCanvas.ActualHeight / PhotoCaptureDevice.PreviewResolution.Width;
                    double yRatio = VideoCanvas.ActualWidth / PhotoCaptureDevice.PreviewResolution.Height;

                    // adjust to center focus on the tap point
                    var displayOrigin = new Windows.Foundation.Point(
                        tapPoint.Y - _focusRegionSize.Width / 2,
                        (VideoCanvas.ActualWidth - tapPoint.X) - _focusRegionSize.Height / 2);

                    // adjust for resolution difference between preview image and the canvas
                    var viewFinderOrigin = new Windows.Foundation.Point(displayOrigin.X / xRatio, displayOrigin.Y / yRatio);
                    var focusrect        = new Windows.Foundation.Rect(viewFinderOrigin, _focusRegionSize);

                    // clip to preview resolution
                    var viewPortRect = new Windows.Foundation.Rect(0, 0, PhotoCaptureDevice.PreviewResolution.Width,
                                                                   PhotoCaptureDevice.PreviewResolution.Height);
                    focusrect.Intersect(viewPortRect);

                    PhotoCaptureDevice.FocusRegion = focusrect;

                    // show a focus indicator
                    FocusIndicator.SetValue(Shape.StrokeProperty, _notFocusedBrush);
                    FocusIndicator.SetValue(Canvas.LeftProperty, uiTapPoint.X - _focusRegionSize.Width / 2);
                    FocusIndicator.SetValue(Canvas.TopProperty, uiTapPoint.Y - _focusRegionSize.Height / 2);
                    FocusIndicator.SetValue(VisibilityProperty, Visibility.Visible);

                    CameraFocusStatus status = await PhotoCaptureDevice.FocusAsync();

                    if (status == CameraFocusStatus.Locked)
                    {
                        FocusIndicator.SetValue(Shape.StrokeProperty, _focusedBrush);
                        _manuallyFocused = true;
                        PhotoCaptureDevice.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters,
                                                       AutoFocusParameters.Exposure & AutoFocusParameters.Focus & AutoFocusParameters.WhiteBalance);
                    }
                    else
                    {
                        _manuallyFocused = false;
                        PhotoCaptureDevice.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters, AutoFocusParameters.None);
                    }

                    _focusSemaphore.Release();
                }

                await Capture();
            }
            catch (Exception exception)
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    new CustomMessageDialog(
                        AppMessages.CaptureVideoFailed_Title,
                        String.Format(AppMessages.CaptureVideoFailed, exception.Message),
                        App.AppInformation,
                        MessageDialogButtons.Ok).ShowDialog();
                });
            }
        }