Exemplo n.º 1
0
 public TrueWeekViewController(DateTime date)
 {
     weekView = new TrueWeekView (date) { Frame = new RectangleF (0, 0, 480, 220) };
     SetCurrentDate (date);
     View.AddSubview (weekView);
 }
Exemplo n.º 2
0
        public RotatingCalendarView(RectangleF rect, float tabBarHeight)
        {
            notificationObserver = NSNotificationCenter.DefaultCenter.AddObserver ("EKEventStoreChangedNotification", EventsChanged);
            this.Title = Util.MyTitle;
            CurrentDate = DateTime.Today;
            SingleDayView = new CalendarDayTimelineView (rect, tabBarHeight);
            WeekView = new TrueWeekView (CurrentDate);
            WeekView.UseCalendar = true;
            LandscapeLeftView = WeekView;
            LandscapeRightView = WeekView;
            PortraitView = SingleDayView;
            SingleDayView.OnEventClicked += theEvent =>
            {
                if (theEvent != null) {
                    if (OnEventClicked != null) {
                        OnEventClicked (theEvent);
                    }
                }
            };

            WeekView.OnEventClicked += theEvent =>
            {
                if (theEvent != null) {
                    if (OnEventClicked != null) {
                        OnEventClicked (theEvent);
                    }
                }
            };
            SingleDayView.dateChanged += theDate => { CurrentDate = theDate; };
            this.OnEventClicked += theEvent =>
            {

                //Util.MyEventStore.RemoveEvents(Util.getEvent(theEvent),EKSpan.ThisEvent,theError.Handle);
                addController = new EKEventEditViewController ();

                // set the addController's event store to the current event store.
                addController.EventStore = Util.MyEventStore;
                addController.Event = Util.getEvent (theEvent);

                addController.Completed += delegate(object sender, EKEventEditEventArgs e)
                {
                    this.DismissModalViewControllerAnimated (true);
                };

                try {
                    if (this.ModalViewController == null)
                        this.NavigationController.PresentModalViewController (addController, true);
                } catch (Exception ex) {
                    //rotatingView.NavigationController.PopViewControllerAnimated(false);
                }
            };
        }
Exemplo n.º 3
0
            /*
            [Export ("layerClass")]
            public static Class LayerClass()
            {
                return new  Class( typeof(weekTopLevelLayer));
            }
            */
            public WeekTopView(TrueWeekView theParent)
            {
                Opaque = true;

                parent = theParent;
                Frame = new RectangleF (0, 0, TotalWidth, 35);
                BackgroundColor = UIColor.White;
            }