Exemple #1
0
 void Service_Tapped(object sender, TappedEventArgs e)
 {
     if (e.Content.PoiTypeId == "Terminal")
     {
         var db = AppState.Dashboards.FirstOrDefault(k => k.Title == "Terminal");
         if (db == null) return;
         AppState.Dashboards.ActiveDashboard = db;
     }
 }
Exemple #2
0
        /// <summary>
        /// Called, when mouse/finger/pen tapped on map 2 or more times
        /// </summary>
        /// <param name="screenPosition">First clicked/touched position on screen</param>
        /// <param name="numOfTaps">Number of taps on map (2 is a double click/tap)</param>
        /// <returns>True, if the event is handled</returns>
        private bool OnDoubleTapped(Geometries.Point screenPosition, int numOfTaps)
        {
            var args = new TappedEventArgs(screenPosition, numOfTaps);

            DoubleTap?.Invoke(this, args);

            if (args.Handled)
            {
                return(true);
            }

            var eventReturn = InvokeInfo(screenPosition, screenPosition, numOfTaps);

            if (eventReturn?.Handled == true)
            {
                return(true);
            }

            // Double tap as zoom
            return(OnZoomIn(screenPosition));
        }
Exemple #3
0
        /// <summary>
        /// Called, when mouse/finger/pen tapped on map one time
        /// </summary>
        /// <param name="screenPosition">Clicked/touched position on screen</param>
        /// <returns>True, if the event is handled</returns>
        private bool OnSingleTapped(Geometries.Point screenPosition)
        {
            var args = new TappedEventArgs(screenPosition, 1);

            SingleTap?.Invoke(this, args);

            if (args.Handled)
            {
                return(true);
            }

            var infoToInvoke = InvokeInfo(screenPosition, screenPosition, 1);

            if (infoToInvoke?.Handled == true)
            {
                return(true);
            }

            OnInfo(infoToInvoke);
            return(infoToInvoke?.Handled ?? false);
        }
Exemple #4
0
        /// <summary>
        /// Called, when mouse/finger/pen tapped on map one time
        /// </summary>
        /// <param name="screenPosition">Clicked/touched position on screen</param>
        /// <returns>True, if the event is handled</returns>
        private bool OnSingleTapped(Geometries.Point screenPosition)
        {
            var args = new TappedEventArgs(screenPosition, 1);

            SingleTap?.Invoke(this, args);

            if (args.Handled)
            {
                return(true);
            }

            var eventReturn = InvokeInfo(Map.Layers, Map.GetWidgetsOfMapAndLayers(), Viewport, screenPosition,
                                         screenPosition, _renderer.SymbolCache, WidgetTouched, 1);

            if (eventReturn != null)
            {
                return(eventReturn.Handled);
            }

            return(false);
        }
        /// <summary>
        /// Raise OnTapped Method in Selection Controller
        /// </summary>
        /// <param name="e">TappedRoutedEventArgs</param>
        internal void OnTapped(TappedEventArgs e)
        {
            if (this.GridColumn != null && this.GridColumn.DataGrid != null)
            {
                var cellTappedEventArgs = new GridCellTappedEventArgs(this.ColumnElement)
                {
                    Column         = this.GridColumn,
                    RowColumnIndex = new RowColumnIndex(this.RowIndex, this.ColumnIndex),
                    Record         = this.ColumnElement.DataContext,
#if WPF
                    ChangedButton = e.ChangedButton
#else
                    PointerDeviceType = e.PointerDeviceType
#endif
                };
                this.GridColumn.DataGrid.RaiseCellTappedEvent(cellTappedEventArgs);
            }
            var columnindex = this.IsExpanderColumn ? this.SelectionController.CurrentCellManager.CurrentRowColumnIndex.ColumnIndex : this.ColumnIndex;

            this.SelectionController.HandlePointerOperations(new GridPointerEventArgs(PointerOperation.Tapped, e), new RowColumnIndex(this.RowIndex, this.ColumnIndex));
        }
Exemple #6
0
    private void TapRecognizer_Tapped(TappedEventArgs obj)
    {
        testObj = obj;
        if (writeState == 0) //Turn ON writing
        {
            writeState = 1;
        }

        else if (writeState == 1)//Turn OFF writing
        {
            //Save the number of points for a single drawing in an int array
            drawingLengths.Add(SingleDraw.Count - numOfPoints);
            //Update numOfPoints
            numOfPoints = SingleDraw.Count;

            //Debug.Log("Size of SingleDraw BEFORE clear: " + SingleDraw.Count());
            //Debug.Log("Size of AllDrawings: " + AllDrawings.Count());
            //Debug.Log("Size of SingleDraw AFTER clear: " + SingleDraw.Count());
            writeState = 0;
        }
    }
    public void onTapped(TappedEventArgs args)
    {
        var headPosition  = args.headPose.position;
        var gazeDirection = args.headPose.forward;

        RaycastHit hitInfo;

        if (Physics.Raycast(headPosition, gazeDirection, out hitInfo, 10.0f, Physics.DefaultRaycastLayers))
        {
            // If the raycast hit a hologram, use that as the focused object.
            FocusedObject = hitInfo.collider.gameObject;

            string[] segs = { "Brain_Part_02", "Brain_Part_04", "Brain_Part_05", "Brain_Part_06" };
            if (segs.Any(FocusedObject.name.Equals))
            {
                if (FocusedObject.name == "Brain_Part_04")
                {
                    FocusedObject.transform.Translate(Vector3.left * 0.1f, Space.World);
                }
                else if (FocusedObject.name == "Brain_Part_06")
                {
                    FocusedObject.transform.Translate(Vector3.right * 0.1f, Space.World);
                }
                else if (FocusedObject.name == "Brain_Part_02")
                {
                    FocusedObject.transform.Translate(Vector3.up * 0.5f, Space.World);
                }
                else if (FocusedObject.name == "Brain_Part_05")
                {
                    FocusedObject.transform.Translate(Vector3.up * 0.2f, Space.World);
                }
            }
        }
        else
        {
            // If the raycast did not hit a hologram, clear the focused object.
            FocusedObject = null;
        }
    }
Exemple #8
0
 /// <summary>
 /// Detects the User Tap Input
 /// </summary>
 private void GestureRecognizer_Tapped(TappedEventArgs obj)
 {
     // Ensure the bot is being gazed upon.
     if (base.FocusedObject != null)
     {
         // If the user is tapping on Bot and the Bot is ready to listen
         if (base.FocusedObject.name == "Bot" && Bot.Instance.botState == Bot.BotState.ReadyToListen)
         {
             // If a conversation has not started yet, request one
             if (Bot.Instance.conversationStarted)
             {
                 Bot.Instance.SetBotResponseText("Listening...");
                 Bot.Instance.StartCapturingAudio();
             }
             else
             {
                 Bot.Instance.SetBotResponseText("Requesting conversation...");
                 StartCoroutine(Bot.Instance.StartConversation());
             }
         }
     }
 }
        private async void OnTriggerTapped(object sender, TappedEventArgs args)
        {
            await trigger.ScaleTo(0.95, 100, easing : Easing.SinIn);

            await trigger.ScaleTo(1, 100, easing : Easing.SinIn);

            var scanner = new ZXing.Mobile.MobileBarcodeScanner();
            var result  = await scanner.Scan();

            if (result != null)
            {
                var location = await LocationService.Instance.GetCurrentPosition();

                var item = new ScanItem
                {
                    Barcode   = result.Text,
                    Timestamp = new DateTime(result.Timestamp),
                    Location  = location
                };
                BarcodeList.Add(item);
            }
        }
    /// <summary>
    /// Respond to Tap Input.
    /// </summary>
    private void TapHandler(TappedEventArgs obj)
    {
        audioClickButton.Play();

        if (MainSceneManager.ApplicationState == MainSceneManager.ApplicationStateType.VisionState)
        {
            // Only allow capturing, if not currently processing a request.
            //if (currentlyCapturing == false)
            //{
            //    currentlyCapturing = true;

            // increment taps count, used to name images when saving
            tapsCount++;

            // Create a label in world space using the ResultsLabel class
            ResultsLabel.instance.CreateLabel();

            // Begins the image capture and analysis procedure
            ExecuteImageCaptureAndAnalysis();
            ////}
        }
    }
        void OnTappedItem(object sender, EventArgs args)
        {
            TappedEventArgs tea = (TappedEventArgs)args;

            int currentPage = 0;

            int.TryParse(tea.Parameter.ToString(), out currentPage);

            if (mTarget == "Enroll")
            {
                try
                {
                    var mainPage   = new MenuPage();
                    var drawerPage = new DrawerPage();
                    drawerPage.OnMenuSelect = (categoryPage) =>
                    {
                        mainPage.Detail = new NavigationPage(categoryPage)
                        {
                            BarBackgroundColor = Color.FromHex("#ffffff"),
                            BarTextColor       = Color.Black
                        };
                        mainPage.IsPresented = false;
                    };
                    mainPage.Master = drawerPage;

                    mainPage.Detail = new NavigationPage(new EnrollListPage(currentPage))
                    {
                        BarBackgroundColor = Color.FromHex("#ffffff"),//your color here
                        BarTextColor       = Color.Black
                    };
                    App.Current.MainPage = mainPage;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(@"				ERROR {0}", ex.Message);
                };
            }
        }
        private void GestureRecognizerTapped(TappedEventArgs args)
        {
            uint id = args.source.id;

            StatusText.text = $"Tapped - Kind:{args.source.kind.ToString()} - Id:{id}";
            if (trackingObject.ContainsKey(activeId))
            {
                ChangeObjectColor(trackingObject[activeId], TapColor);
                StatusText.text += "-TRACKED";
                // code to send ray
                // code to tap if IInputClickHandler is present

                RaycastHit hit;
                if (Physics.Raycast(trackingObject[activeId].transform.position, trackingObject[activeId].transform.TransformDirection(-Vector3.forward), out hit, Mathf.Infinity))
                {
                    if (hit.collider.gameObject.GetComponent <IInputClickHandler>() != null)
                    {
                        InputClickedEventData data = new InputClickedEventData(GameObject.Find("EventSystem").GetComponent <EventSystem>());
                        hit.collider.gameObject.GetComponent <IInputClickHandler>().OnInputClicked(data);
                    }
                }
            }
        }
        public void OnAdd(object sender, TappedEventArgs e)
        {
            if (_vm.ItemsSource != null)
            {
                _vm.ItemsSource.Add(new MyFirstView()
                {
                    BindingContext = myCarousel.ItemsSource.GetCount()
                });
                // Do this to trigger PositionSelected
                //if (_vm.ItemsSource.Count > 0)
                ///{
                //_vm.ItemsSource.Add(_vm.ItemsSource.Max() + 1);
                //_vm.Position = _vm.ItemsSource.Count - 1;
                //}
                //else
                //{
                //_vm.ItemsSource.Add(0);
                //}

                // Do this to refresh Prev/Next visibility
                //ConfigureButtons();
            }
        }
    private void NavigationRecognizer_Tapped(TappedEventArgs obj)
    {
        // Pause/Resume dictation to allow user speaking

        // Debug: move them to HandManager

        /*
         * if (GazeManager.Instance != null && GazeManager.Instance.Hit)
         * {
         *  GameObject focusedObject = GazeManager.Instance.HitInfo.collider.gameObject;
         *
         *  // Note: the method is not migrated yet.
         *  // I found that the Unity will create something like "CustomNotes(Clone)"
         *  if (focusedObject.name.Contains("CustomNotes"))
         *  {
         *      CustomNotesObject notesObject = focusedObject.GetComponent<CustomNotesObject>();
         *      Debug.Log(string.Format("Tap on:{0}, page #{1}", notesObject.fileName, notesObject.page));
         *      pageOrganizer.NotePage.UpdateContextDocument(notesObject.fileName, notesObject.page);
         *  }
         *  else if (focusedObject.name.Contains("Btn"))
         *  {
         *      Button btn = focusedObject.GetComponent<Button>();
         *      btn.onClick.Invoke();
         *      //focusedObject.SendMessage("OnSelect", focusedObject, SendMessageOptions.DontRequireReceiver);
         *  }
         *  else if (focusedObject.name.Contains("Pie"))
         *  {
         *      PieMenu pieMenu = focusedObject.GetComponent<PieMenu>();
         *      // Invoke on current cursor position
         *      pieMenu.MousePressed(true, Vector2.zero);
         *      //pieMenu.MousePressed(new Vector2(GazeManager.Instance.Position.x - focusedObject.transform.position.x, GazeManager.Instance.Position.y - focusedObject.transform.position.y), true);
         *  }
         *
         *  Debug.Log("Tap:" + focusedObject.name + " parent: " + focusedObject.transform.parent.gameObject.name + ", pos: " + GazeManager.Instance.Position);
         * }
         */
    }
Exemple #15
0
    void OnTapped(TappedEventArgs args)
    {
        //Debug.Log("Air Tapped:" + args.headPose.position.ToString());
        Debug.Log("Air Tapped:" + userHead.transform.position.ToString());
        //Vector3 front = new Vector3(0, 0, 1);

        //args.headPose.rotation

        Vector3 pos     = userHead.transform.position;
        Vector3 forward = userHead.transform.forward;

        RaycastHit hitInfo;

        if (Physics.Raycast(pos, forward, out hitInfo))
        {
            hitPos = hitInfo.point;
            isHit  = true;

            GameObject gobj;
            gobj = Instantiate(marker);
            gobj.transform.SetParent(transform, false);
        }
        else
        {
            hitPos = Vector3.zero;
            isHit  = false;
        }


        /*
         * Generator gen = GetComponent<Generator>();
         * if(gen != null)
         * {
         *      gen.spawnTarget(pos);
         * }*/
    }
Exemple #16
0
 private void TapHandler(TappedEventArgs obj) /// Respond to Tap Input.
 {
     tapsCount++;
     ExecuteImageCaptureAndAnalysis();
 }
Exemple #17
0
 private void GestureRecognizerOnTapped(TappedEventArgs tappedEventArgs)
 {
     IsPlaced = !IsPlaced;
 }
Exemple #18
0
 private async void XFBackbtn_Tapped(object sender, TappedEventArgs e)
 {
     await App.NavigationPage.Navigation.PopAsync();
 }
 private async void Configuration_Convention(object sender, EventArgs e)
 {
     TappedEventArgs tappedEventArgs = (TappedEventArgs)e;
     Convention      convention      = ((ConventionViewModel)BindingContext).Conventions.Where(ser => ser.id == (int)tappedEventArgs.Parameter).FirstOrDefault();
     await PopupNavigation.Instance.PushAsync(new ConfigurationConventionPage(convention));
 }
Exemple #20
0
 private void ServiceTapped(object sender, TappedEventArgs e)
 {
     if (WayPoints.Count >= 8) return; // Max waypoints in Google
     var poi = e.Content as PoI;
     if (poi == null || poi != Poi) return;
     AddWayPoint(e.TapPoint);
 }
Exemple #21
0
 protected void OnTappedEvent(TappedEventArgs obj)
 {
     inputManager.RaiseInputClicked(this, (uint)obj.source.id, obj.tapCount);
 }
 private void ImageTapped(object sender, TappedEventArgs e)
 {
     Navigation.PushAsync(new SecondPage());
 }
 private async void Update_ReportCatalog(object sender, EventArgs e)
 {
     TappedEventArgs tappedEventArgs = (TappedEventArgs)e;
     ReportCatalog   report          = ((ReportCatalogViewModel)BindingContext).ReportCatalogs.Where(ser => ser.id == (int)tappedEventArgs.Parameter).FirstOrDefault();
     await PopupNavigation.Instance.PushAsync(new UpdateReportCatalogPage(report));
 }
Exemple #24
0
 /// <summary>
 ///     Poi was tapped, look for 'Path' label and select folder
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PsTapped(object sender, TappedEventArgs e)
 {
     var ps = sender as PoiService;
     if (ps == null) return;
     ActivePath = ps.Folder;
     if (!e.Content.Labels.ContainsKey("Path")) return;
     var p = StartPath + "\\" + e.Content.Labels["Path"];
     if (Directory.Exists(p)) SelectFolder(p);
 }
Exemple #25
0
 private void DataServer_Tapped(object sender, TappedEventArgs e) {
     if (!e.Content.Labels.ContainsKey("PresenterPath") ||
         string.IsNullOrEmpty(e.Content.Labels["PresenterPath"])) return;
     var presenterPath = e.Content.Labels["PresenterPath"];
     // Check if folder is part of the startup path
     if (presenterPath.ToLower().Contains("[/url]")) {
         var m = Regex.Match(presenterPath);
         if (m.Success) presenterPath = m.Groups[1].Value;
     }
     
     // Check if we need to navigate to a subfolder of the activate path
     var p = System.IO.Path.Combine(StartPath, presenterPath);
     if (Directory.Exists(p)) {
         SelectFolder(p);
         return;
     }
     // Check if we need to navigate to a subfolder of the active path
     p = System.IO.Path.Combine(ActivePath, presenterPath);
     if (Directory.Exists(p)) {
         SelectFolder(p);
         return;
     }
     // Check if we need to navigate to a subfolder of start path
     p = System.IO.Path.Combine(StartPath, presenterPath);
     if (Directory.Exists(p)) {
         SelectFolder(p);
         return;
     }
     // Check if we need to navigate to a fully speficied path
     if (Directory.Exists(presenterPath))
     {
         SelectFolder(presenterPath);
     }
     else {
         // Check if the folder is a subfolder of one of the addiotional folders.
         foreach (
             var path in AdditionalFolders.Select(folder => System.IO.Path.Combine(folder, presenterPath)).Where(Directory.Exists)) {
             SelectFolder(path);
             return;
         }
     }
     // Check to see if we are dealing with a single file
     var file = System.IO.Path.Combine(Path, presenterPath);
     if (File.Exists(file) && (file.EndsWith("exe") || file.EndsWith("bat"))) {
         Process.Start(file);
         return;
     }
     file = System.IO.Path.Combine(ActivePath, presenterPath);
     if (File.Exists(file) && (file.EndsWith("exe") || file.EndsWith("bat"))) {
         Process.Start(file);
         return;
     }
     file = presenterPath;
     if (File.Exists(file) && (file.EndsWith("exe") || file.EndsWith("bat"))) Process.Start(file);
 }
 /// <summary>
 /// When a PoI is selected in another layer, disable the menu item.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DisableMenuItem(object sender = null, TappedEventArgs e = null)
 {
     circularMenuItem.IsEnabled = false;
     circularMenuItem.Opacity = 0.5;
     circularMenuItem.Fill = Brushes.Gray;
     circularMenuItem.Background = Brushes.Red;
 }
 /// <summary>
 /// タップしたら Recognizer を変えて色を変える
 /// </summary>
 /// <param name="obj"></param>
 private void ManipulationRecognizer_Tapped(TappedEventArgs obj)
 {
     this.Transition(this.NavigationRecognizer);
     GazeManager.Instance.HitObject.SendMessage("OnSelect");
 }
Exemple #28
0
 void RecognizerTapped(TappedEventArgs args)
 {
     text.text += "\ntap";
 }
Exemple #29
0
 void recognizer_Tapped(GestureRecognizer sender, TappedEventArgs args)
 {
 }
 private void Tap(TappedEventArgs eventArgs)
 {
     tapEventCallback.Invoke();
     Debug.Log("Tapped");
 }
        public async Task OnAdd(object sender, TappedEventArgs e)
        {
            await myCarousel.InsertPage(myCarousel.ItemsSource.Count + 1);

            myCarousel.SetCurrentPage(myCarousel.ItemsSource.Count - 1);
        }
 private void OnTappedEvent(TappedEventArgs args)
Exemple #33
0
        // TODO: robertes: Should these also cause source state data to be stored/updated? What about SourceDetected synthesized events?

        protected void GestureRecognizer_Tapped(TappedEventArgs args)
        {
            InputManager.Instance.RaiseInputClicked(this, args.source.id, InteractionSourcePressInfo.Select, args.tapCount);
        }
 void PoiServiceTapped(object sender, TappedEventArgs e)
 {
     var poi = e.Content as PoI;
     if (poi == null) return;
     if (CanPoiBeEvaluated(poi))
     {
         EnableMenuItem();
         selectedPoi = poi;
         if (!isEditorVisible || selectedPoi == null) return;
         //ZoomAndPoint();
         avm.SelectedPoI = selectedPoi;
         //AppState.TriggerNotification("Tapped");
     }
     else
     {
         selectedPoi = null;
         DisableMenuItem();
         HideEditor();
     }
 }
 private void OnTapped(TappedEventArgs args)
 {
     // Place the scene in front of the camera when the user taps.
     ResetView();
 }
Exemple #36
0
 public void TriggerTapped(TappedEventArgs tappedEventArgs){
     var handler = Tapped;
     if (handler != null) handler(this, tappedEventArgs);
 }
 private void OnMoreInformation(object sender, TappedEventArgs e)
 {
     Device.OpenUri(CurrentFlag.MoreInformationUrl);
 }
        private void ServiceOnTapped(object sender, TappedEventArgs e)
        {
            var poi = e.Content as PoI;
            if (poi == null) return;
            var linkPoiTypeParameter = Model.Model.Parameters.FirstOrDefault(p => string.Equals(p.Name, "LinkPoiType", StringComparison.InvariantCultureIgnoreCase));
            if (linkPoiTypeParameter == null) return;
            var linkPoiType = linkPoiTypeParameter.Value;
            var poiType = Model.Service.PoITypes.OfType<PoI>().FirstOrDefault(pt => string.Equals(pt.PoiId, linkPoiType, StringComparison.InvariantCultureIgnoreCase));
            if (poiType == null) return;

            var position = poi.Position ?? CalculateCenter(poi);
            var link = new PoI
            {
                Id = Guid.NewGuid(),
                PoiTypeId = linkPoiType,
                Layer = PoI.Layer + "_link",
                Labels = new Dictionary<string, string> {
                    { "IsActive", "true" },
                    { "QoS", "100"},
                    {Model.Id + ".CreatorId", PoI.Id.ToString() },
                    {Model.Id + ".NetworkName", selectedNetwork.Title },
                    {Model.Id + ".SourceId", lastPoi.Id.ToString() },
                    {Model.Id + ".SinkId", poi.Id.ToString() },
                },
                Points = new ObservableCollection<Point> {
                    new Point {X = lastPoi.Position.Longitude, Y = lastPoi.Position.Latitude},
                    new Point {X = position.Longitude, Y = position.Latitude}
                }
            };
            var strokeColor = (Color)ColorConverter.ConvertFromString(selectedColor);
            link.Style = new PoIStyle { StrokeColor = strokeColor };
            Model.Service.PoIs.Add(link);
            lastPoi = poi;
        }