public void bindDataToUI(Event theEvent) { eventDayLabel.Text = theEvent.EventDate.Value.Day.ToString (); eventWeekDayLabel.Text = ((DateTime)theEvent.EventDate).ToString ("ddd"); eventTitleLabel.Text = theEvent.Title; var eventOnline = theEvent.EventStartTime == null || theEvent.EventEndTime == null; eventTimeLabel.Text = eventOnline ? "See Details" : theEvent.EventStartTime.Value.ToShortTimeString () + " - " + theEvent.EventEndTime.Value.ToShortTimeString (); // eventTitleLabel.Font = UIFont.FromName ("Gotham-Book", 14.0f); // eventTimeLabel.Font = UIFont.FromName ("Gotham-Bold", 14.0f); // eventDayLabel.Font = UIFont.FromName ("Gotham-Light", 32.0f); // eventWeekDayLabel.Font = UIFont.FromName ("Gotham-Bold", 14.0f); }
public static void ManipulateEvent(Event thisEvent, string note) { try { EKEvent newEvent = EKEvent.FromStore(EventSingleton.Current.EventStore); // Add the content to the event if (thisEvent.EventDate != null) { if (thisEvent.EventStartTime != null) { newEvent.StartDate = DateTime.SpecifyKind(thisEvent.EventStartTime.Value, DateTimeKind.Local); newEvent.AddAlarm(EKAlarm.FromTimeInterval(-900)); } if (thisEvent.EventEndTime != null) newEvent.EndDate = DateTime.SpecifyKind(thisEvent.EventEndTime.Value, DateTimeKind.Local); } newEvent.Title = thisEvent.Title; newEvent.Location = thisEvent.Place ?? ""; newEvent.Notes = note; // set the event saving preference newEvent.Calendar = EventSingleton.Current.EventStore.DefaultCalendarForNewEvents; //saving this event NSError e; EventSingleton.Current.EventStore.SaveEvent(newEvent, EKSpan.ThisEvent, out e); if (e != null) BTProgressHUD.ShowErrorWithStatus("Error to save this event"); else BTProgressHUD.ShowSuccessWithStatus("Your event is saved in Calendar!"); } catch (Exception) { new UIAlertView("Exception", "Something is wrong to save the event.", null, "OK", null).Show(); } }
public EventDetailViewController(Event thisEvent) : base("EventDetailViewController", null) { _thisEvent = thisEvent; }
public EventPopoverViewContent(Event thisEvent) : base("EventPopoverViewContent", null) { _thisEvent = thisEvent; }
public void PresentView(Event thisEvent) { EventStore = EventSingleton.Current.EventStore; if (thisEvent.EventDate != null) { if (thisEvent.EventStartTime != null) { Event.StartDate = DateTime.SpecifyKind(thisEvent.EventStartTime.Value, DateTimeKind.Local); Event.AddAlarm(EKAlarm.FromTimeInterval(-900)); } if (thisEvent.EventEndTime != null) Event.EndDate = DateTime.SpecifyKind(thisEvent.EventEndTime.Value, DateTimeKind.Local); } Event.Title = thisEvent.Title; Event.Location = thisEvent.Place ?? ""; Event.Notes = thisEvent.Description; }