private async Task GetData()
        {
            SantaTeclaService sevice = new SantaTeclaService();

            if (_quien == 0)
            {
                ListPacientes.ItemsSource = await sevice.GetPacientes();
            }
            else
            {
                ListPacientes.ItemsSource = await sevice.GetPersonal();
            }
            Ok.Click += (sender, args) =>
            {
                if (ListPacientes.SelectedItem != null)
                {
                    OnItemSelected?.Invoke(this, new ItemSelectedEventArgs
                    {
                        Objecto = ListPacientes.SelectedItem
                    });
                    this.Close();
                }
                else
                {
                    Xceed.Wpf.Toolkit.MessageBox.Show("Selecciones una opcion", "Informacion de ayuda", MessageBoxButton.OK,
                                                      MessageBoxImage.Stop);
                }
            };
        }
 public void MakeSelection(int id)
 {
     if (OnItemSelected != null)
     {
         OnItemSelected.Invoke(id);
     }
 }
        /// <summary>
        ///     Populates the list of products that will actually be shown, using the current filters.
        /// </summary>
        public void PopulateProducts()
        {
            Products.RemoveAllChildren();

            var search = _searchBar.Text.Trim().ToLowerInvariant();

            foreach (var prototype in Owner.Market.Products)
            {
                // if no search or category
                // else if search
                // else if category and not search
                if ((search.Length == 0 && _category == null) ||
                    (search.Length != 0 && prototype.Name.ToLowerInvariant().Contains(search)) ||
                    (search.Length == 0 && _category != null && prototype.Category.Equals(_category)))
                {
                    var button = new CargoProductRow();
                    button.Product               = prototype;
                    button.ProductName.Text      = prototype.Name;
                    button.PointCost.Text        = prototype.PointCost.ToString();
                    button.Icon.Texture          = prototype.Icon.Frame0();
                    button.MainButton.OnPressed += (args) =>
                    {
                        OnItemSelected?.Invoke(args);
                    };
                    Products.AddChild(button);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Set the selected radio button index in child.
        /// </summary>
        /// <param name="index">send the message with index.</param>
        /// <param name="val">Value if true or false.</param>
        /// <param name="currentSelectedButton"> action for callback.</param>
        public void SetCurrentButtonSelected(int index, bool val, Action currentSelectedButton)
        {
            if (this.j_CurrentSelectedButton != null)
            {
                this.j_CurrentSelectedButton.Invoke();
                for (int i = 0; i < onItemDeselected.GetPersistentEventCount(); i++)
                {
                    ((MonoBehaviour)onItemDeselected.GetPersistentTarget(i)).SendMessage(onItemDeselected.GetPersistentMethodName(i), j_CurrentSelectedIndex);
                }
                OnItemDeselected?.Invoke(j_CurrentSelectedIndex);
                j_RadioButtons[j_CurrentSelectedIndex].SetDynamicValueChange(false);
            }

            this.j_CurrentSelectedButton = currentSelectedButton;
            j_CurrentSelectedIndex       = index;
            if (this.j_CurrentSelectedButton != null)
            {
                for (int i = 0; i < onItemSelected.GetPersistentEventCount(); i++)
                {
                    ((MonoBehaviour)onItemSelected.GetPersistentTarget(i)).SendMessage(onItemSelected.GetPersistentMethodName(i), j_CurrentSelectedIndex);
                }
                OnItemSelected?.Invoke(j_CurrentSelectedIndex);
            }
            j_RadioButtons[index].SetDynamicValueChange(val);
        }
Example #5
0
 public void MakeSelection(ClickMenuItem item)
 {
     if (OnItemSelected != null)
     {
         OnItemSelected.Invoke(item);
     }
 }
Example #6
0
 private void itemSelectedCallback(IAsyncResult ar)
 {
     if (OnItemSelected != null)
     {
         OnItemSelected.EndInvoke(ar);
     }
 }
Example #7
0
        async Task OnSelected(SearchItem <TItem>?item)
        {
            lastSelectedItem = item;
            InputValue       = item?.Text ?? "";

            if (RecentRepository != null && item != null)
            {
                await RecentRepository.AddHit(item.Key);

                item.LastHit = DateTime.Now;
            }

            if (OnItemSelected.HasDelegate)
            {
                await OnItemSelected.InvokeAsync(item?.DataObject);
            }

            if (ClearAfterSelection)
            {
                ClearInputValue();
            }
            else
            {
                Calculate();
            }

            isOpen = false;
        }
Example #8
0
 void OnWeaponSlot(object value)
 {
     SelectedItemIndex = -1;
     SelectedItemData  = PW.WeaponData;
     OnItemSelected?.Invoke(-1);
     RefreshInfo();
 }
Example #9
0
        protected async Task ItemSelected(EqTreeItem selectedItem)
        {
            SetSelectedTreeItem(selectedItem);

            var originalObject = FindObjectFromDatasource(selectedItem);

            await OnItemSelected.InvokeAsync(originalObject);
        }
Example #10
0
 /// <summary>
 /// this method will raise the OnItemSelected() event to let any
 /// listener know that this item has been selected by the user in a
 /// list,thumbnail, filmstrip, or coverflow control
 /// </summary>
 /// <param name="parent"></param>
 public void ItemSelected(GUIControl parent)
 {
     if (OnItemSelected != null)
     {
         AsyncCallback callback = new AsyncCallback(itemSelectedCallback);
         OnItemSelected.BeginInvoke(this, parent, callback, this);
     }
 }
Example #11
0
        private async Task UpdateSelected()
        {
            await OnItemSelected.InvokeAsync(SelectedItem);

            await SelectedItemsChanged.InvokeAsync(SelectedItems);

            await Update();
        }
Example #12
0
 protected override void ItemSelected(AdvancedDropdownItem item)
 {
     base.ItemSelected(item);
     if (item is AdvancedTypePopupItem typePopupItem)
     {
         OnItemSelected?.Invoke(typePopupItem);
     }
 }
        public void SelectItem(T item, int index)
        {
            T previousItem = Item;

            Item = item;
            UpdateSelectedItem();
            UpdateItems();
            OnItemSelected?.Invoke(previousItem, item, index);
        }
Example #14
0
 public CollectionViewController(UICollectionViewLayout layout, OnItemSelected onItemSelected) : base(layout)
 {
     items = new List <string>();
     for (int i = 0; i < 20; i++)
     {
         items.Add($"#{i}");
     }
     _onItemSelected = onItemSelected;
 }
Example #15
0
 private void SelectItem(ICustomListItem item)
 {
     if (CurrentSelectedItem == item)
     {
         return;
     }
     CurrentSelectedItem = item;
     OnItemSelected?.Invoke(item);
 }
Example #16
0
        private void initButtonListener(Transform buttonTransform)
        {
            int index = buttonTransform.GetComponent <ElementIndexer>().StaticIndex;

            if (mStaticSlotItemMapping.TryGetValue(index, out ItemView view))
            {
                OnItemSelected?.Invoke(view.ItemId);
            }
        }
Example #17
0
        public void CheckItemSelection()
        {
            var selected = CompletionListBox.SelectedItem as WordCompletion;

            if (selected != null && OnItemSelected != null)
            {
                OnItemSelected.Invoke(selected.ToString());
            }
        }
Example #18
0
 public void ClearInvocationList()
 {
     System.Delegate[] deletegates = OnItemSelected.GetInvocationList();
     for (int i = 0; i < deletegates.Length; i++)
     {
         // Remove all events
         OnItemSelected -= deletegates[i] as Action <GameObject>;
     }
 }
        public void SelectItem(T item)
        {
            T previousItem = Item;

            Item = item;
            UpdateSelectedItem();
            UpdateItems();
            OnItemSelected?.Invoke(previousItem, item, Group.Items.Values.IndexOf(item));
        }
        public static Item NewItem(GUIContent content, OnItemSelected selector, object data = null)
        {
            var it = new Item();

            it.content          = content;
            it.selectedCallback = selector;
            it.data             = data;
            return(it);
        }
Example #21
0
    //////////////
    public void OnPointerClick(PointerEventData eventData)
    {
        OnItemSelected?.Invoke(m_Item);

        if (m_Item == null)
        {
            return;
        }

        m_EquipButton.gameObject.SetActive(!m_EquipButton.gameObject.activeSelf);
    }
 private void PlaylistSelected(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems.Count > 0)
     {
         var flyout = (Windows.UI.Xaml.Controls.FlyoutPresenter) this.Parent;
         OnItemSelected.Invoke(flyout, new PlaylistSelectedEventArgs()
         {
             SelectedPlaylist = (ViewPlaylistMetadata)e.AddedItems[0]
         });
     }
 }
Example #23
0
        /// <summary>
        /// Invoked when the user selects a completion option.
        /// Removes the intellisense popup, and displays the method completion popup
        /// if the selected item is a method.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="args">Event Arguments.</param>
        private void ContextItemSelected(object sender, NeedContextItemsArgs.ContextItem args)
        {
            IntellisenseItemSelectedArgs itemSelectedArgs = new IntellisenseItemSelectedArgs()
            {
                TriggerWord  = triggerWord,
                ItemSelected = args.Name + (args.IsMethod ? "(" : ""),
                IsMethod     = args.IsMethod
            };

            OnItemSelected?.Invoke(this, itemSelectedArgs);
        }
Example #24
0
        private void SelectMonthTile(TopPanelItem selectedMonthTile)
        {
            monthTiles [SelectedItem].IsSelected = false;

            selectedMonthTile.IsSelected = true;
            SelectedItem = monthTiles.IndexOf(selectedMonthTile);
            ScrollToAsync(SelectedItem * 115, 0, false);

            OnItemSelected.Dispatch(selectedMonthTile.ContentView);

            SelectDay(1);
        }
Example #25
0
        protected internal override void MouseDown(GUIMouseButtonEventArgs args)
        {
            base.MouseDown(args);

            var item = _tryFindItemAtPosition(args.RelativePosition);

            if (item != null && item.Selectable)
            {
                _selectedIndex = item.Index;
                OnItemSelected?.Invoke();
            }
        }
Example #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GridDataSource"/> class.
 /// </summary>
 /// <param name="onGetCell">The on get cell.</param>
 /// <param name="onRowsInSection">The on rows in section.</param>
 /// <param name="onItemSelected">The on item selected.</param>
 public GridDataSource(OnGetCell onGetCell,
                       OnRowsInSection onRowsInSection,
                       OnItemSelected onItemSelected,
                       OnNumberOfSections onNumberOfSections,
                       OnGetViewForSupplementaryElement onGetViewForSupplementaryElement)
 {
     _onGetCell          = onGetCell;
     _onRowsInSection    = onRowsInSection;
     _onItemSelected     = onItemSelected;
     _onNumberOfSections = onNumberOfSections;
     _onGetViewForSupplementaryElement = onGetViewForSupplementaryElement;
 }
        protected void HandleSelect(int index)
        {
            if (selectedIndex != -1 && selectedIndex != index)
            {
                transform.GetChild(selectedIndex).GetComponent <IListEntry>().Deselect();
            }
            int oldIndex = index;

            selectedIndex = index;
            SubHandleSelect(oldIndex);
            OnItemSelected?.Invoke(oldIndex);
        }
Example #28
0
        private async Task OnClearClick()
        {
            Value    = "";
            Argument = "";
            await ValueChanged.InvokeAsync("");

            await ArgumentChanged.InvokeAsync("");

            await OnItemSelected.InvokeAsync("");

            IsSelected = false;
        }
Example #29
0
        private void ItemSelected(TableView _, int row)
        {
            var obj = _listObjects[row];

            if (obj is ListDirectory dir)
            {
                OnCategorySelected?.Invoke(dir.ListName);
                return;
            }

            _currentIdx = row;
            OnItemSelected?.Invoke(obj);
        }
Example #30
0
 private void ItemRow_OnSelected(UCEItemRow itemRow)
 {
     if (itemRow.Selected)
     {
         SelectedItemRow?.Deselect();
         SelectedItemRow = itemRow;
         OnItemSelected?.Invoke(itemRow);
     }
     else
     {
         SelectedItemRow = null;
         OnItemSelected?.Invoke(null);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GridViewDelegate"/> class.
 /// </summary>
 /// <param name="onItemSelected">The on item selected.</param>
 public CollectionViewDelegate(OnItemSelected onItemSelected)
 {
     this._onItemSelected = onItemSelected;
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="GridDataSource"/> class.
		/// </summary>
		/// <param name="onGetCell">The on get cell.</param>
		/// <param name="onRowsInSection">The on rows in section.</param>
		/// <param name="onItemSelected">The on item selected.</param>
		public GridDataSource (OnGetCell onGetCell, OnRowsInSection onRowsInSection, OnItemSelected onItemSelected)
		{
			_onGetCell = onGetCell;
			_onRowsInSection = onRowsInSection;
			_onItemSelected = onItemSelected;
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="GridViewDelegate"/> class.
		/// </summary>
		/// <param name="onItemSelected">The on item selected.</param>
		public GridViewDelegate (OnItemSelected onItemSelected, OnScrolled onScrolled)
		{
			_onItemSelected = onItemSelected;
			_onScrolled = onScrolled;
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="GridViewDelegate"/> class.
		/// </summary>
		/// <param name="onItemSelected">The on item selected.</param>
		public GridViewDelegate (OnItemSelected onItemSelected)
		{
			_onItemSelected = onItemSelected;
		}