private async void GenEventListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { //// Deselect previous //if (selectedGenEvent != null) //{ // selectedGenEvent.SetColors(false); //} //// Select new //selectedGenEvent = (genEventListView.SelectedItem as GenEvent); //selectedGenEvent.SetColors(true); if (e.SelectedItem != null) { GenEvent selectedEvent = (GenEvent)e.SelectedItem; var page = (PopupPage)Activator.CreateInstance(typeof(GenEventFull)); page.BindingContext = selectedEvent; //await this.Navigation.PushAsync(page); await PopupNavigation.Instance.PushAsync(page); Device.BeginInvokeOnMainThread(() => { genEventListView.SelectedItem = null; }); } }
void ICalendar.AddToCalendar(GenEvent genEvent) { var estZone = TimeZoneInfo.FindSystemTimeZoneById("America/Indiana/Indianapolis"); var newStartTime = TimeZoneInfo.ConvertTime(genEvent.StartDateTime, estZone, TimeZoneInfo.Local); var newEndTime = TimeZoneInfo.ConvertTime(genEvent.EndDateTime, estZone, TimeZoneInfo.Local); eventStore = eventStore ?? new EKEventStore(); eventStore.RequestAccess(EKEntityType.Event, (bool granted, NSError e) => { if (granted) { EKEventStore eventStore = new EKEventStore(); //Insert the data into the agenda. EKEvent newEvent = EKEvent.FromStore(eventStore); newEvent.StartDate = CalendarHelpers.DateTimeToNSDate(newStartTime); newEvent.EndDate = CalendarHelpers.DateTimeToNSDate(newEndTime); newEvent.Title = genEvent.Title; newEvent.Notes = genEvent.Location + "\r\n\r\n" + genEvent.Description + "\r\n\r\n" + genEvent.LiveURL ; EKAlarm[] alarmsArray = new EKAlarm[1]; alarmsArray[0] = EKAlarm.FromDate(newEvent.StartDate.AddSeconds(-600)); newEvent.Alarms = alarmsArray; newEvent.Calendar = eventStore.DefaultCalendarForNewEvents; eventStore.SaveEvent(newEvent, EKSpan.ThisEvent, true, out e); Device.BeginInvokeOnMainThread(() => { //bool returned = await GlobalVars.notifier.Notify(ToastNotificationType.Success, // "Event added!", genEvent.Title + " has been added to your calendar!", TimeSpan.FromSeconds(3)); //var returned = await GlobalVars.notifier.Notify(new NotificationOptions() //{ // Title = "Event added!", // Description = genEvent.Title + " has been added to your calendar!", //}); GlobalVars.DoToast(genEvent.Title + " has been added to your calendar!", GlobalVars.ToastType.Green); }); } //do something here else { Device.BeginInvokeOnMainThread(() => { //bool returned = await GlobalVars.notifier.Notify(ToastNotificationType.Error, // "Don't have permission!", "You need to allow this app to access the calendar first. Please change the setting in Settings -> Privacy -> Calendars.", TimeSpan.FromSeconds(4)); //var returned = await GlobalVars.notifier.Notify(new NotificationOptions() //{ // Title = "Don't have permission!", // Description = "You need to allow this app to access the calendar first. Please change the setting in Settings -> Privacy -> Calendars.", //}); GlobalVars.DoToast("Need permission - you need to allow this app to access the calendar first. Please change the setting in Settings -> Privacy -> Calendars.", GlobalVars.ToastType.Red, 5000); }); } }); }
public static void Ex3() { GenEvent gnEvent = new GenEvent(); RecEvent inventoryWatch = new RecEvent(gnEvent); gnEvent.UpdateEvent("грузовика", -2); gnEvent.UpdateEvent("автопоезда", 4); }
private void OpenAddToListPrompt() { GenEvent currentEvent = (GenEvent)this.BindingContext; userEventLists = GlobalVars.db.UserEventLists; userListPicker.ItemsSource = UserListsTitles; popupHolder.IsVisible = true; }
static void Main(string[] args) { Console.OutputEncoding = Encoding.Unicode; GenEvent gnEvent = new GenEvent(); RecEvent inventoryWatch = new RecEvent(gnEvent); gnEvent.UpdateEvent("грузовика", -2); gnEvent.UpdateEvent("автопоезда", 4); }
public void Process() { GenEvent <T> ev = GetEvent(); List <IEventProcessor <T> > list; if (_subscribers.TryGetValue(ev.EType, out list)) { foreach (var sub in list) { // do something } } }
private void UserEventListItem_Tapped(object sender, ItemTappedEventArgs e) { GenEvent currentEvent = (GenEvent)this.BindingContext; if (e.Item != null) { try { var selectedList = (string)e.Item; if (!string.IsNullOrEmpty(selectedList)) { Task.Factory.StartNew(async() => { if (selectedList == newListString) { selectedList = "My New List"; var newList = await GlobalVars.db.AddUserEventList(selectedList); newList.Events.Add(currentEvent); newList.HasEventListChangedSinceSync = true; await GlobalVars.db.UpdateUserEventListWithChildrenAsync(newList); GlobalVars.View_GenUserListView.IsUpdateRequested = true; //selectedList = newList.Title; } else { var currentList = await GlobalVars.db.GetUserEventListWithChildrenAsync(userEventLists.FirstOrDefault(d => d.Title == selectedList)); if (currentList != null) { currentList.Events.Add(currentEvent); currentList.Events = currentList.Events.Distinct().OrderBy(d => d.StartDateTime).ToList(); currentList.HasEventListChangedSinceSync = true; await GlobalVars.db.UpdateUserEventListWithChildrenAsync(currentList); GlobalVars.View_GenUserListView.IsUpdateRequested = true; } } //Device.BeginInvokeOnMainThread(() => //{ GlobalVars.DoToast($"Added \"{currentEvent.ID}\" to list.", GlobalVars.ToastType.Green); //}); }); } } catch (Exception ex) { string fart = ex.Message; } } popupHolder.IsVisible = false; }
// private GenEvent selectedGenEvent = null; private async void GenEventListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) { //// Deselect previous //if (selectedGenEvent != null) //{ // selectedGenEvent.SetColors(false); //} //// Select new //selectedGenEvent = (genEventListView.SelectedItem as GenEvent); //selectedGenEvent.SetColors(true); if (e.SelectedItem != null) { GenEvent selectedEvent = (GenEvent)e.SelectedItem; Page page = (Page)Activator.CreateInstance(typeof(GenEventFull)); page.BindingContext = selectedEvent; await this.Navigation.PushAsync(page); } }
void ICalendar.AddToCalendar(GenEvent genEvent) { var estZone = TimeZoneInfo.FindSystemTimeZoneById("America/Indianapolis"); var newStartTime = TimeZoneInfo.ConvertTime(genEvent.StartDateTime, estZone, TimeZoneInfo.Local); var newEndTime = TimeZoneInfo.ConvertTime(genEvent.EndDateTime, estZone, TimeZoneInfo.Local); //var newStartTime = genEvent.StartDateTime; //var newEndTime = genEvent.EndDateTime; var minTimeDifference = new TimeSpan(0, 15, 0); var actualTimeDifference = genEvent.EndDateTime.Subtract(genEvent.StartDateTime); if (actualTimeDifference < minTimeDifference) { newEndTime = TimeZoneInfo.ConvertTime(genEvent.StartDateTime.Add(minTimeDifference), estZone, TimeZoneInfo.Local); //newEndTime = genEvent.StartDateTime.Add(minTimeDifference); } var intent = new Intent(Intent.ActionInsert, Android.Net.Uri.Parse("content://com.android.calendar/events")) //.SetType("vnd.android.cursor.dir/event") .PutExtra(CalendarContract.ExtraEventBeginTime, GetDateTimeMS(newStartTime)) .PutExtra(CalendarContract.ExtraEventEndTime, GetDateTimeMS(newEndTime)) .PutExtra(CalendarContract.ExtraEventAllDay, false) //.PutExtra(CalendarContract.Events.InterfaceConsts.EventTimezone, "America/Indianapolis") //.PutExtra(CalendarContract.Events.InterfaceConsts.EventEndTimezone, "America/Indianapolis") .PutExtra(CalendarContract.Events.InterfaceConsts.Title, genEvent.Title) .PutExtra(CalendarContract.Events.InterfaceConsts.Description, genEvent.Location + "\r\n\r\n" + genEvent.Description + "\r\n\r\n" + genEvent.LiveURL) .PutExtra(CalendarContract.Events.InterfaceConsts.EventLocation, genEvent.Location) //.PutExtra(CalendarContract.Events.InterfaceConsts.Availability, EventsAvailability.Busy) //.PutExtra(CalendarContract.Events.InterfaceConsts.AccessLevel, EventsAccess.Private) ; //Forms.Context.StartActivity(Intent.CreateChooser(intent, "Create Calendar Event")); CurrentContext.StartActivity(intent); }
void LoadEvents() { events.Clear(); using (var s = new BinaryReader(new FileStream(EventsFileName, FileMode.Open))) { int count = s.ReadInt32(); for (int i = 0; i < count; i++) { var ev = new GenEvent(); ev.time = s.ReadSingle(); ev.position.x = s.ReadSingle(); ev.position.y = s.ReadSingle(); events.Add(ev); } } for (int i = events.Count - 1; i >= 0; i--) { var ev = events[i]; //ev.time -= ; events[i] = ev; } Debug.LogFormat("Loaded {0} events", events.Count); }
public void SetGenEventUpdateNotificationAsRead(GenEvent genEvent) { genEvent.HasUpdateNotifications = false; database.UpdateAsync(genEvent).Wait(); }
public static void AddToCalendar(GenEvent genEvent) { DependencyService.Get <ICalendar>().AddToCalendar(genEvent); }
public static List <EventChangeLog> GetChanges(GenEvent oldEvent, GenEvent newEvent, DateTime changeTime) { var returnMe = new List <EventChangeLog>(); if (oldEvent.ID != newEvent.ID) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "ID", OldValue = oldEvent.ID, NewValue = newEvent.ID, GenEventID = oldEvent.ID }); } if (oldEvent.GroupCompany != newEvent.GroupCompany) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "GroupCompany", OldValue = oldEvent.GroupCompany, NewValue = newEvent.GroupCompany, GenEventID = oldEvent.ID }); } if (oldEvent.Title != newEvent.Title) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "Title", OldValue = oldEvent.Title, NewValue = newEvent.Title, GenEventID = oldEvent.ID }); } if (oldEvent.Description != newEvent.Description) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "Description", OldValue = oldEvent.Description, NewValue = newEvent.Description, GenEventID = oldEvent.ID }); } if (oldEvent.LongDescription != newEvent.LongDescription) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "LongDescription", OldValue = oldEvent.LongDescription, NewValue = newEvent.LongDescription, GenEventID = oldEvent.ID }); } if (oldEvent.EventType != newEvent.EventType) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "EventType", OldValue = oldEvent.EventType, NewValue = newEvent.EventType, GenEventID = oldEvent.ID }); } if (oldEvent.RulesEdition != newEvent.RulesEdition) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "RulesEdition", OldValue = oldEvent.RulesEdition, NewValue = newEvent.RulesEdition, GenEventID = oldEvent.ID }); } if (oldEvent.GameSystem != newEvent.GameSystem) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "GameSystem", OldValue = oldEvent.GameSystem, NewValue = newEvent.GameSystem, GenEventID = oldEvent.ID }); } if (oldEvent.MinimumPlayers != newEvent.MinimumPlayers) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "MinimumPlayers", OldValue = oldEvent.MinimumPlayers, NewValue = newEvent.MinimumPlayers, GenEventID = oldEvent.ID }); } if (oldEvent.MaximumPlayers != newEvent.MaximumPlayers) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "MaximumPlayers", OldValue = oldEvent.MaximumPlayers, NewValue = newEvent.MaximumPlayers, GenEventID = oldEvent.ID }); } if (oldEvent.MinimumAge != newEvent.MinimumAge) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "MinimumAge", OldValue = oldEvent.MinimumAge, NewValue = newEvent.MinimumAge, GenEventID = oldEvent.ID }); } if (oldEvent.ExperienceRequired != newEvent.ExperienceRequired) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "ExperienceRequired", OldValue = oldEvent.ExperienceRequired, NewValue = newEvent.ExperienceRequired, GenEventID = oldEvent.ID }); } if (oldEvent.MaterialsProvided != newEvent.MaterialsProvided) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "MaterialsProvided", OldValue = oldEvent.MaterialsProvided, NewValue = newEvent.MaterialsProvided, GenEventID = oldEvent.ID }); } if (oldEvent.StartDateTime != newEvent.StartDateTime) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "StartDateTime", OldValue = oldEvent.StartDateTime.ToString(), NewValue = newEvent.StartDateTime.ToString(), GenEventID = oldEvent.ID }); } if (oldEvent.Duration != newEvent.Duration) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "Duration", OldValue = oldEvent.Duration, NewValue = newEvent.Duration, GenEventID = oldEvent.ID }); } if (oldEvent.EndDateTime != newEvent.EndDateTime) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "EndDateTime", OldValue = oldEvent.EndDateTime.ToString(), NewValue = newEvent.EndDateTime.ToString(), GenEventID = oldEvent.ID }); } if (oldEvent.Location != newEvent.Location) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "Location", OldValue = oldEvent.Location, NewValue = newEvent.Location, GenEventID = oldEvent.ID }); } if (oldEvent.GMs != newEvent.GMs) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "GMs", OldValue = oldEvent.GMs, NewValue = newEvent.GMs, GenEventID = oldEvent.ID }); } if (oldEvent.WebAddressMoreInfo != newEvent.WebAddressMoreInfo) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "WebAddressMoreInfo", OldValue = oldEvent.WebAddressMoreInfo, NewValue = newEvent.WebAddressMoreInfo, GenEventID = oldEvent.ID }); } if (oldEvent.EmailAddressMoreInfo != newEvent.EmailAddressMoreInfo) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "EmailAddressMoreInfo", OldValue = oldEvent.EmailAddressMoreInfo, NewValue = newEvent.EmailAddressMoreInfo, GenEventID = oldEvent.ID }); } if (oldEvent.Tournament != newEvent.Tournament) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "Tournament", OldValue = oldEvent.Tournament, NewValue = newEvent.Tournament, GenEventID = oldEvent.ID }); } if (oldEvent.Prerequisite != newEvent.Prerequisite) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "Prerequisite", OldValue = oldEvent.Prerequisite, NewValue = newEvent.Prerequisite, GenEventID = oldEvent.ID }); } if (oldEvent.AvailableTickets != newEvent.AvailableTickets) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "AvailableTickets", OldValue = oldEvent.AvailableTickets.ToString(), NewValue = newEvent.AvailableTickets.ToString(), GenEventID = oldEvent.ID }); } if (oldEvent.Cost != newEvent.Cost) { returnMe.Add(new EventChangeLog { ChangeTime = changeTime, Property = "Cost", OldValue = oldEvent.Cost, NewValue = newEvent.Cost, GenEventID = oldEvent.ID }); } return(returnMe); }
public async Task UpdateGenEventWithChildrenAsync(GenEvent genEvent) { await database.InsertOrReplaceWithChildrenAsync(genEvent); }
public async Task <List <EventChangeLog> > GetEventChangeLogsForGenEvent(GenEvent genEvent) { return(await database.Table <EventChangeLog>().Where(d => d.GenEventID == genEvent.ID).ToListAsync()); }
public void CmdResetEvent( [FromProperty("this")] GenCommandBuffer commandBuffer, GenEvent eventObj, VkPipelineStageFlags stageMask) { }
// в конструкторе класса осуществляется подписка public RecEvent(GenEvent gnEvent) { this.gnEvent = gnEvent; gnEvent.OnChangeHandler += //здесь осуществляется подписка new GenEvent.ChangeEventHandler(OnRecChange); }
public GenEventLongPressArgs(GenEvent genEvent) { this.genEvent = genEvent; }
public async Task SetGenEventUpdateNotificationAsReadAsync(GenEvent genEvent) { genEvent.HasUpdateNotifications = false; await database.UpdateAsync(genEvent); }
public GenEventFull() { CalculatePaddingAmount(); wholePageScroller = new ScrollView { HorizontalOptions = LayoutOptions.Fill, VerticalOptions = LayoutOptions.Fill, Margin = 0, Padding = paddingAmount }; wholePageHolder = new StackLayout { Orientation = StackOrientation.Vertical, Padding = 0, Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; wholePage = new Grid { HorizontalOptions = LayoutOptions.FillAndExpand, Padding = 0, Margin = 0, ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) } }, RowDefinitions = new RowDefinitionCollection() { new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto }, new RowDefinition() { Height = GridLength.Auto } }, VerticalOptions = LayoutOptions.Fill }; //Row 1 //Title Label titleLabel = new Label { FontSize = GlobalVars.sizeLarge, FontAttributes = FontAttributes.Bold }; titleLabel.SetBinding(Label.TextProperty, "Title"); wholePage.Children.Add(titleLabel, 0, 0); Grid.SetColumnSpan(titleLabel, 4); //Avl. Tickets StackLayout avlTicketHorizStack = new StackLayout { Orientation = StackOrientation.Horizontal, Padding = 0, Spacing = 0, HorizontalOptions = LayoutOptions.End }; Label avlTicketsStatic = new Label { FontSize = GlobalVars.sizeMedium, Text = "Avl. Tickets: ", VerticalOptions = LayoutOptions.End }; Label avlTicketsDynamic = new Label { FontSize = GlobalVars.sizeLarge, FontAttributes = FontAttributes.Bold, LineBreakMode = LineBreakMode.NoWrap, VerticalTextAlignment = TextAlignment.End }; avlTicketsDynamic.SetBinding(Label.TextProperty, "AvailableTickets"); avlTicketHorizStack.Children.Add(avlTicketsStatic); avlTicketHorizStack.Children.Add(avlTicketsDynamic); wholePage.Children.Add(avlTicketHorizStack, 4, 0); Grid.SetColumnSpan(avlTicketHorizStack, 2); //Row 2 //GroupCompany Label groupCompanyLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; groupCompanyLabel.SetBinding(Label.TextProperty, "GroupCompany"); wholePage.Children.Add(groupCompanyLabel, 0, 1); Grid.SetColumnSpan(groupCompanyLabel, 4); //FormattedPlayers Label playerNumLabel = new Label { FontSize = GlobalVars.sizeMedium, HorizontalTextAlignment = TextAlignment.End }; playerNumLabel.SetBinding(Label.TextProperty, "FormattedPlayers"); wholePage.Children.Add(playerNumLabel, 4, 1); Grid.SetColumnSpan(playerNumLabel, 2); //Row 3 //EventID Label eventIDLabel = new Label { FontSize = GlobalVars.sizeMedium, TextColor = GlobalVars.colorLink }; eventIDLabel.SetBinding(Label.TextProperty, "ID"); wholePage.Children.Add(eventIDLabel, 0, 2); Grid.SetColumnSpan(eventIDLabel, 4); eventIDLabel.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command <Label>((Label label) => { string newURL = ((GenEvent)this.BindingContext).LiveURL; //string args = label.Text; //string newArgs = args.Substring( // args.Length - Math.Min(5, args.Length) // ); //if (newArgs.StartsWith("0")) //{ // newArgs = args.Substring( // args.Length - Math.Min(6, args.Length) // ); //} //CrossShare.Current.OpenBrowser(String.Format("https://www.gencon.com/events/{0}", newArgs), null); // CrossShare.Current.OpenBrowser(newURL, null); CrossShare.Current.OpenBrowser(newURL, new Plugin.Share.Abstractions.BrowserOptions { ChromeShowTitle = true, UseSafariReaderMode = true, UseSafariWebViewController = true }); //Device.OpenUri( // new Uri( // String.Format("https://www.gencon.com/events/{0}", // args.Substring( // args.Length - Math.Min(5, args.Length) // ) // ) // ) //); }), CommandParameter = eventIDLabel }); //MinimumAge Label minimumAgeLabel = new Label { FontSize = GlobalVars.sizeMedium, HorizontalTextAlignment = TextAlignment.End }; minimumAgeLabel.SetBinding(Label.TextProperty, "MinimumAge"); wholePage.Children.Add(minimumAgeLabel, 4, 2); Grid.SetColumnSpan(minimumAgeLabel, 2); //Row 4 //EventType Label eventTypeLabel = new Label { FontSize = GlobalVars.sizeMedium }; eventTypeLabel.SetBinding(Label.TextProperty, "EventType"); wholePage.Children.Add(eventTypeLabel, 0, 3); Grid.SetColumnSpan(eventTypeLabel, 4); //Cost Label costLabel = new Label { FontSize = GlobalVars.sizeLarge, FontAttributes = FontAttributes.Bold, HorizontalTextAlignment = TextAlignment.End, LineBreakMode = LineBreakMode.NoWrap }; costLabel.SetBinding(Label.TextProperty, "FormattedCost"); wholePage.Children.Add(costLabel, 4, 3); Grid.SetColumnSpan(costLabel, 2); //Row 5 //FormattedDate Label formattedDateLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(0, 1, 0, 0) }; formattedDateLabel.SetBinding(Label.TextProperty, "FormattedDate"); wholePage.Children.Add(formattedDateLabel, 0, 4); Grid.SetColumnSpan(formattedDateLabel, 6); //Row 6 //Location Label locationLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0), TextColor = GlobalVars.colorLink }; locationLabel.SetBinding(Label.TextProperty, "Location"); wholePage.Children.Add(locationLabel, 0, 5); Grid.SetColumnSpan(locationLabel, 6); locationLabel.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command <Label>((Label label) => { DetailChoice navigationLocation = GlobalVars.GetMapName(((GenEvent)this.BindingContext).Location); if (navigationLocation != null) { if (navigationLocation.data.ToLower().StartsWith("http:") || navigationLocation.data.ToLower().StartsWith("https:")) { CrossShare.Current.OpenBrowser(navigationLocation.data, null); } else { Page page = (Page)Activator.CreateInstance(typeof(MapViewPage)); page.BindingContext = navigationLocation; this.Navigation.PushAsync(page); } } }), CommandParameter = locationLabel }); //Row 7 //Description static Label descriptionStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Description:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(descriptionStaticLabel, 0, 6); Grid.SetColumnSpan(descriptionStaticLabel, 6); //Row 8 //Description Label descriptionLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; descriptionLabel.SetBinding(Label.TextProperty, "Description"); wholePage.Children.Add(descriptionLabel, 0, 7); Grid.SetColumnSpan(descriptionLabel, 6); //Row 9 //Long Description static Label longDescriptionStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Long Description:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(longDescriptionStaticLabel, 0, 8); Grid.SetColumnSpan(longDescriptionStaticLabel, 6); //Row 10 //Long Description Label longDescriptionLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; longDescriptionLabel.SetBinding(Label.TextProperty, "LongDescription"); wholePage.Children.Add(longDescriptionLabel, 0, 9); Grid.SetColumnSpan(longDescriptionLabel, 6); //Row 11 //Game System static Label gameSystemStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Game System:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(gameSystemStaticLabel, 0, 10); Grid.SetColumnSpan(gameSystemStaticLabel, 3); //Rules Edition static Label rulesEditionStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Rules Edition:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(rulesEditionStaticLabel, 3, 10); Grid.SetColumnSpan(rulesEditionStaticLabel, 3); //Row 12 //Game System Label gameSystemLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; gameSystemLabel.SetBinding(Label.TextProperty, "GameSystem"); wholePage.Children.Add(gameSystemLabel, 0, 11); Grid.SetColumnSpan(gameSystemLabel, 3); //Rules Edition static Label rulesEditionLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; rulesEditionLabel.SetBinding(Label.TextProperty, "RulesEdition"); wholePage.Children.Add(rulesEditionLabel, 3, 11); Grid.SetColumnSpan(rulesEditionLabel, 3); //Row 13 //Experience Required static Label experienceRequiredStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Experience Required:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(experienceRequiredStaticLabel, 0, 12); Grid.SetColumnSpan(experienceRequiredStaticLabel, 3); //Materials Provided static Label materialsProvidedStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Materials Provided:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(materialsProvidedStaticLabel, 3, 12); Grid.SetColumnSpan(materialsProvidedStaticLabel, 3); //Row 14 //Experience Required Label experienceRequiredLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; experienceRequiredLabel.SetBinding(Label.TextProperty, "ExperienceRequired"); wholePage.Children.Add(experienceRequiredLabel, 0, 13); Grid.SetColumnSpan(experienceRequiredLabel, 3); //Materials Provided Label materialsProvidedLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; materialsProvidedLabel.SetBinding(Label.TextProperty, "MaterialsProvided"); wholePage.Children.Add(materialsProvidedLabel, 3, 13); Grid.SetColumnSpan(materialsProvidedLabel, 3); //Row 15 //Tournament static Label tournamentStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Tournament:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(tournamentStaticLabel, 0, 14); Grid.SetColumnSpan(tournamentStaticLabel, 3); //GMs static Label gmsStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "GM(s):", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(gmsStaticLabel, 3, 14); Grid.SetColumnSpan(gmsStaticLabel, 3); //Row 16 //Tournament Label tournamentLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; tournamentLabel.SetBinding(Label.TextProperty, "Tournament"); wholePage.Children.Add(tournamentLabel, 0, 15); Grid.SetColumnSpan(tournamentLabel, 3); //GMs Label gmsLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; gmsLabel.SetBinding(Label.TextProperty, "GMs"); wholePage.Children.Add(gmsLabel, 3, 15); Grid.SetColumnSpan(gmsLabel, 3); //Row 17 //Prerequisite static Label prerequisiteStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Prerequisite:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(prerequisiteStaticLabel, 0, 16); Grid.SetColumnSpan(prerequisiteStaticLabel, 6); //Row 18 //Prerequisite Label prerequisiteLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0) }; prerequisiteLabel.SetBinding(Label.TextProperty, "Prerequisite"); wholePage.Children.Add(prerequisiteLabel, 0, 17); Grid.SetColumnSpan(prerequisiteLabel, 6); //Row 19 //Web address static Label webAddressStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Web Address For More Info:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(webAddressStaticLabel, 0, 18); Grid.SetColumnSpan(webAddressStaticLabel, 6); //Row 20 //Web address Label webAddressLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0), TextColor = GlobalVars.colorLink }; webAddressLabel.SetBinding(Label.TextProperty, "WebAddressMoreInfo"); wholePage.Children.Add(webAddressLabel, 0, 19); Grid.SetColumnSpan(webAddressLabel, 6); webAddressLabel.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command <Label>((Label label) => { string args = label.Text; CrossShare.Current.OpenBrowser(args.StartsWith("http") ? args : "http://" + args, null); //Device.OpenUri( // new Uri( // args.StartsWith("http") ? args : "http://" + args // ) //); }), CommandParameter = webAddressLabel }); //Row 21 //Email address static Label emailAddressStaticLabel = new Label { FontSize = GlobalVars.sizeMedium, FontAttributes = FontAttributes.Bold, Text = "Email Address For More Info:", Margin = new Thickness(0, 1, 0, 0) }; wholePage.Children.Add(emailAddressStaticLabel, 0, 20); Grid.SetColumnSpan(emailAddressStaticLabel, 6); //Row 22 //Web address Label emailAddressLabel = new Label { FontSize = GlobalVars.sizeMedium, Margin = new Thickness(10, 0, 0, 0), TextColor = GlobalVars.colorLink }; emailAddressLabel.SetBinding(Label.TextProperty, "EmailAddressMoreInfo"); wholePage.Children.Add(emailAddressLabel, 0, 21); Grid.SetColumnSpan(emailAddressLabel, 6); emailAddressLabel.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command <Label>((Label label) => { string args = label.Text; Device.OpenUri( new Uri( "mailto:" + args.Trim() ) ); }), CommandParameter = emailAddressLabel }); //Row 23 //LastUpdatedMessage Label lastUpdatedLabel = new Label { FontSize = GlobalVars.sizeSmall, FontAttributes = FontAttributes.Italic, Margin = new Thickness(10, 1, 0, 0) }; lastUpdatedLabel.SetBinding(Label.TextProperty, "FormattedUpdateTime"); wholePage.Children.Add(lastUpdatedLabel, 0, 22); Grid.SetColumnSpan(lastUpdatedLabel, 6); wholePageScroller.Content = wholePage; popupHolder = new StackLayout { Orientation = StackOrientation.Vertical, Padding = new Thickness(20, 20, 20, 20), BackgroundColor = Color.White }; Label entryLabel = new Label { Text = "Select a list from below: " }; popupHolder.Children.Add(entryLabel); userListPicker = new ListView() { HeightRequest = 200 }; userListPicker.ItemTapped += UserEventListItem_Tapped; popupHolder.Children.Add(userListPicker); StackLayout buttonHolder = new StackLayout { Orientation = StackOrientation.Horizontal, Padding = new Thickness(10, 10, 10, 10), }; //Button OKButton = new Button() //{ // Text = "OK" //}; //OKButton.Clicked += OKButton_Clicked; Button CancelButton = new Button() { Text = "Cancel" }; CancelButton.Clicked += Cancel_Clicked; //buttonHolder.Children.Add(OKButton); buttonHolder.Children.Add(CancelButton); popupHolder.Children.Add(buttonHolder); popupHolder.IsVisible = false; wholePageHolder.Children.Add(popupHolder); ToolbarItems.Add(new ToolbarItem("Add To Calendar", "ic_today_black_24dp.png", () => { GenEvent currentEvent = (GenEvent)this.BindingContext; GlobalVars.AddToCalendar(currentEvent); })); ToolbarItems.Add(new ToolbarItem("Share", "ic_share_black_24dp.png", () => { GenEvent currentEvent = (GenEvent)this.BindingContext; CrossShare.Current.Share(new Plugin.Share.Abstractions.ShareMessage { Url = currentEvent.LiveURL, Text = currentEvent.Description, Title = currentEvent.Title }, new Plugin.Share.Abstractions.ShareOptions { ChooserTitle = "Share Event" }); // CrossShare.Current.ShareLink(currentEvent.LiveURL, currentEvent.Description, currentEvent.Title); })); ToolbarItems.Add(new ToolbarItem("Add To List", "addlist.png", () => { OpenAddToListPrompt(); })); AbsoluteLayout.SetLayoutBounds(wholePageHolder, new Rectangle(0, 0, 1, 1)); AbsoluteLayout.SetLayoutFlags(wholePageHolder, AbsoluteLayoutFlags.All); //AbsoluteLayout.SetLayoutFlags(loadingLabel, // AbsoluteLayoutFlags.PositionProportional); //AbsoluteLayout.SetLayoutBounds(loadingLabel, // new Rectangle(0.5, // 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); //AbsoluteLayout.SetLayoutFlags(popupHolder, // AbsoluteLayoutFlags.PositionProportional); //AbsoluteLayout.SetLayoutBounds(popupHolder, // new Rectangle(0.5, // 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); wholePageHolder.Children.Add(wholePageScroller); this.Content = wholePageHolder; OnOrientationChanged += DeviceRotated; }