Esempio n. 1
0
 public void Visit(ShowEvents node)
 {
     if (node.Schema != null)
     {
         _schemaTrimmed = true;
         node.Schema    = null;
     }
     TableMetaRead(null);
 }
Esempio n. 2
0
        private async void BuildingSelected(string Key)
        {
            // If show events animation has not been played, fire it
            if (!IsShowEvents)
            {
                ShowEvents.Begin();
                IsShowEvents = true;
            }

            if (IsExpandMap)
            {
                ExpandMap();
            }

            // Reset the Events Collection
            Events.Clear();
            // Display loading bar
            EventsLoading.Visibility = Visibility.Visible;

            try
            {
                // Always set newtork issue text to collapsed
                NoNetwork.Visibility = Visibility.Collapsed;
                // Query for those events based on the key
                Events = new ObservableCollection <Event>(await App.MobileService.GetTable <Event>().Where(o => o.Locations.Contains(Key)).Select(o => o).ToListAsync());
            }
            catch (Exception e)
            {
                if (IsShowEvents)
                {
                    NoNetwork.Visibility = Visibility.Visible;
                }
                return;
            }
            // Remove events that have already happened
            DateTime ParsedDate = new DateTime();

            foreach (Event e in Events)
            {
                if (DateTime.TryParse(e.Date, out ParsedDate))
                {
                    var date = ParsedDate.ToString("d").Split(new string[] { "/" }, StringSplitOptions.None);
                    if (date.Length >= 2)
                    {
                        e.Date = String.Format("{0}/{1}", date[0], date[1]);
                    }
                }
            }

            // Set the results of the query to the UI Collection
            EventList.DataContext = Events;
            // Hide loading bar
            EventsLoading.Visibility = Visibility.Collapsed;

            if (Events.Count <= 0)
            {
                NoEvents.Visibility = Visibility.Visible;
            }
            else
            {
                NoEvents.Visibility = Visibility.Collapsed;
            }
        }
Esempio n. 3
0
 public virtual void Visit(ShowEvents node)
 {
     VisitInternal(node.Schema);
     VisitInternal(node.Where);
 }