/// <summary> /// Called when an event is double tapped. /// </summary> /// <param name="AnEvent">An event.</param> /// <param name="sender">Sender.</param> internal void DoubleTappedEvent(DSCalendarEvent AnEvent, object sender) { if (this.Superview != null && this.Superview is DSCalendarGridView) { ((DSCalendarGridView)this.Superview).DoubleTappedEvent(AnEvent, this); } }
/// <summary> /// Initializes a new instance of the <see cref="DSoft.UI.Calendar.Views.OSX.OSXEventView"/> class. /// </summary> /// <param name="Frame">Frame.</param> /// <param name="AnEvent">An event.</param> /// <param name="ViewType">View type.</param> public OSXEventView(RectangleF Frame, DSCalendarEvent AnEvent, DSEventType ViewType) : base(Frame, AnEvent, ViewType) { this.BackgroundColor = UIColor.Clear; mTitleLabel = new UILabel(RectangleF.Empty); mTitleLabel.BackgroundColor = UIColor.Clear; mTitleLabel.TextColor = UIColor.Black; mTitleLabel.Font = UIFont.SystemFontOfSize(12); this.AddSubview(mTitleLabel); }
internal void DoubleTappedEvent(DSCalendarEvent AnEvent, object sender) { if (this.Superview != null && this.Superview is DSCalendarView) { var grid = this.Superview as DSCalendarView; if (grid.DataSource != null) { grid.DataSource.DidDoubleTapEventView(this.Superview, sender, AnEvent); } } }
/// <summary> /// Initializes a new instance of the <see cref="DSoft.UI.Calendar.Views.Metro.MetroEventView"/> class. /// </summary> /// <param name="Frame">Frame.</param> /// <param name="AnEvent">An event.</param> /// <param name="ViewType">View type.</param> public MetroEventView(RectangleF Frame, DSCalendarEvent AnEvent, DSEventType ViewType) : base(Frame, AnEvent, ViewType) { this.BackgroundColor = UIColor.Clear; mTitleLabel = new UILabel(Rectangle.Empty); mTitleLabel.BackgroundColor = UIColor.Clear; mTitleLabel.TextColor = UIColor.White; mTitleLabel.TextAlignment = UITextAlignment.Left; mTitleLabel.Font = UIFont.SystemFontOfSize(14); mTitleLabel.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; this.AddSubview(mTitleLabel); }
/// <summary> /// Called when an event is double tapped /// </summary> /// <returns>The double tap event view.</returns> /// <param name="sender">Sender.</param> /// <param name="AnEvent">An event.</param> /// <param name="CalendarView">Calendar view.</param> public void DidDoubleTapEventView(object CalendarView, object sender, DSCalendarEvent AnEvent) { if (CalendarView is DSCalendarView) { EKEvent mySavedEvent = EventStore.EventFromIdentifier(AnEvent.EventID); if (mySavedEvent != null) { ShowEventEditor(mySavedEvent, CalendarView as DSCalendarView, sender); } var parentVC = CalendarView as DSCalendarView; if (parentVC.ParentViewController != null) { } } }
/// <summary> /// Initialize the specified AnEvent and ViewType. /// </summary> /// <param name="AnEvent">An event.</param> /// <param name="ViewType">View type.</param> private void Initialize(DSCalendarEvent AnEvent, DSEventType ViewType) { this.Opaque = false; this.ClipsToBounds = true; mEvent = AnEvent; mType = ViewType; this.AutosizesSubviews = true; this.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; this.DoubleTap += () => { if (this.Superview != null && this.Superview is DSCalendarEventsView) { ((DSCalendarEventsView)this.Superview).DoubleTappedEvent(Event, this); } }; }
/// <summary> /// Returns the Events for a specific date range /// </summary> /// <returns>The for date.</returns>> /// <param name="StartDate">Start date.</param> /// <param name="EndDate">End date.</param> public DSCalendarEventCollection EventsForDates(DateTime StartDate, DateTime EndDate) { var results = new DSCalendarEventCollection(); NSPredicate query = EventStore.PredicateForEvents(StartDate, EndDate, EKCalendarsInList(mVisibleCalendars)); EKEvent[] events = EventStore.EventsMatching(query); if (events != null) { foreach (EKEvent anEvent in events) { var aDsEvent = new DSCalendarEvent(); aDsEvent.EventID = anEvent.EventIdentifier; aDsEvent.Title = anEvent.Title; aDsEvent.StartDate = anEvent.StartDate; aDsEvent.EndDate = anEvent.EndDate; if (anEvent.TimeZone == null) { aDsEvent.StartDate = aDsEvent.StartDate.ToLocalTime(); aDsEvent.EndDate = aDsEvent.EndDate.ToLocalTime(); } aDsEvent.EventColor = new UIColor(anEvent.Calendar.CGColor).ToDSColor(); aDsEvent.IsAllDay = anEvent.AllDay; results.Add(aDsEvent); } } return(results); }
/// <summary> /// Initializes a new instance of the <see cref="DSoft.UI.Calendar.Views.DSEventView"/> class. /// </summary> /// <param name="Frame">Frame.</param> /// <param name="AnEvent">An event.</param> /// <param name="ViewType">View type.</param> public DSEventView(RectangleF Frame, DSCalendarEvent AnEvent, DSEventType ViewType) : base(Frame) { Initialize(AnEvent, ViewType); }
/// <summary> /// Get the EventView for the Event /// </summary> /// <returns>The view for event.</returns> /// <param name="Data">Data.</param> /// <param name="ViewType">View type.</param> public override DSEventView EventViewForEvent(DSCalendarEvent Data, DSEventType ViewType) { return(new Views.iOS.iOSEventView(RectangleF.Empty, Data, ViewType)); }
/// <summary> /// Get the EventView for the Event /// </summary> /// <returns>The view for event.</returns> /// <param name="Data">Data.</param> /// <param name="ViewType">View type.</param> public abstract DSEventView EventViewForEvent(DSCalendarEvent Data, DSEventType ViewType);