Inheritance: MonoTouch.Dialog.Element
Ejemplo n.º 1
0
            public MonthEventCellView(MonthEventElement parent)
                : base(UITableViewCellStyle.Value1, key)
            {
                this.parent = parent;

                circleView = new Circle {
                    Color = parent.TheEvent.color, BackgroundColor = UIColor.Clear
                };
                setupTimeLabels();

                BackgroundColor = UIColor.Clear;
                label           = new UILabel {
                    TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.Title, Font = font, TextColor = parent.TheEvent.IsBooking ? UIColor.Red : UIColor.Gray, Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation, BackgroundColor = UIColor.Clear
                };
                lblSub = new UILabel {
                    TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.location, Font = subFont, TextColor = UIColor.Gray, BackgroundColor = UIColor.Clear
                };
                btnDelete = new UIButton(UIButtonType.Custom);
                btnDelete.SetTitleColor(UIColor.Black, UIControlState.Normal);
                btnDelete.SetBackgroundImage(UIImage.FromFile("Images/black_icon_delete.png"), UIControlState.Normal);


                //btnEdit = new UIButton (UIButtonType.Custom);
                //btnEdit.SetTitleColor(UIColor.Black, UIControlState.Normal);
                //btnEdit.SetBackgroundImage(UIImage.FromFile("Images/black_icon_edit_64.png"), UIControlState.Normal);


                ContentView.Add(circleView);
                ContentView.Add(timeSubLabel);
                ContentView.Add(timeLabel);
                ContentView.Add(label);
                ContentView.Add(lblSub);
                ContentView.Add(btnDelete);
                //ContentView.Add(btnEdit);
            }
Ejemplo n.º 2
0
            public MonthEventCellView(MonthEventElement parent) : base(UITableViewCellStyle.Value1, key)
            {
                this.parent = parent;

                circleView = new Circle {
                    Color = parent.TheEvent.color, BackgroundColor = UIColor.Clear
                };
                setupTimeLabels();

                BackgroundColor = UIColor.Clear;
                label           = new UILabel {
                    TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.Title, Font = font, TextColor = UIColor.Black, Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation, BackgroundColor = UIColor.Clear
                };
                lblSub = new UILabel {
                    TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.location, Font = subFont, TextColor = UIColor.Gray, BackgroundColor = UIColor.Clear
                };

                ContentView.Add(circleView);
                ContentView.Add(timeSubLabel);
                ContentView.Add(timeLabel);
                ContentView.Add(label);
                ContentView.Add(lblSub);
            }
Ejemplo n.º 3
0
 public void UpdateFrom(MonthEventElement newParent)
 {
     parent = newParent;
     Refresh();
 }
Ejemplo n.º 4
0
        public RootElement getMonthDayEvents()
        {
            var section = new Section ();

            foreach (var theEvent in monthEvents.Where (x => x.startDate.Date == currentDate || x.endDate.Date == currentDate).OrderBy(x=> x.startDate).ToList ()) {
                var theelement = new MonthEventElement (theEvent);
                theelement.OnEventClicked += theClickedEvent =>
                {
                    if (OnEventClicked != null)
                        OnEventClicked (theClickedEvent);
                };
                section.Add (theelement);
                //dailyEvents.Add(new CalendarDayEventView(theEvent));
            }
            return new RootElement ("") { section };
        }
Ejemplo n.º 5
0
 public void UpdateFrom(MonthEventElement newParent)
 {
     parent = newParent;
     Refresh();
 }
Ejemplo n.º 6
0
            public MonthEventCellView(MonthEventElement parent)
                : base(UITableViewCellStyle.Subtitle, key)
            {
                this.parent = parent;

                //circleView = new Circle { Color = parent.TheEvent.color, BackgroundColor = UIColor.Clear };
                //image = new UIImageView(UIImage.FromFile("Images/Calendar/leftarrow.png"));
                setupTimeLabels();

                BackgroundColor = UIColor.Clear;
                label = new UILabel { TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.Title, Font = font, TextColor = UIColor.Black, Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation, BackgroundColor = UIColor.Clear };
                lblSub = new UILabel { TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.location, Font = subFont, TextColor = UIColor.Gray, BackgroundColor = UIColor.Clear };

                //ContentView.Add (circleView);
                //ContentView.Add(image);
                //ContentView.Add (timeSubLabel);
                ContentView.Add(timeLabel);
                ContentView.Add(label);
                ContentView.Add(lblSub);

                if (parent.TheEvent.Event.CustomAction != null)
                {
                    parent.TheEvent.Event.CustomAction(this);
                }
            }
Ejemplo n.º 7
0
            public MonthEventCellView(MonthEventElement parent)
                : base(UITableViewCellStyle.Value1, key)
            {
                this.parent = parent;

                circleView = new Circle { Color = parent.TheEvent.color, BackgroundColor = UIColor.Clear };
                setupTimeLabels ();

                BackgroundColor = UIColor.Clear;
                label = new UILabel { TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.Title, Font = font, TextColor = UIColor.Black, Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation, BackgroundColor = UIColor.Clear };
                lblSub = new UILabel { TextAlignment = UITextAlignment.Left, Text = parent.TheEvent.location, Font = subFont, TextColor = UIColor.Gray, BackgroundColor = UIColor.Clear };

                ContentView.Add (circleView);
                ContentView.Add (timeSubLabel);
                ContentView.Add (timeLabel);
                ContentView.Add (label);
                ContentView.Add (lblSub);
            }
Ejemplo n.º 8
0
        public RootElement getMonthDayEvents()
        {
            var section = new Section();

            if (!_isPortrait)
            {
                var monthSign = new MonthTitleElement(currentMonth.ToString("MMMM yyyy"), "", UITableViewCellStyle.Default);
                monthSign.TextColor = UIColor.Gray;
                section.Add(monthSign);
            }

            var list = monthEvents.Where(x => x.startDate.Date == currentDate || x.endDate.Date == currentDate).OrderBy(x => x.startDate).ToList();
            foreach (var theEvent in list)
            {
                if (theEvent.Event.ShowOnlyInLandscape.HasValue)
                {
                    if (theEvent.Event.ShowOnlyInLandscape == _isPortrait)
                    {
                        continue;
                    }
                }

                var theelement = new MonthEventElement(theEvent);
                theelement.OnEventClicked += theClickedEvent =>
                {
                    if (OnEventClicked != null)
                        OnEventClicked(theClickedEvent);
                };
                section.Add(theelement);
                //dailyEvents.Add(new CalendarDayEventView(theEvent));
            }

            //var addEventElement = new MonthTitleElement(NSBundle.MainBundle.LocalizedString("Schedule message", ""), "", UITableViewCellStyle.Default);
            //addEventElement.Font = UIFont.SystemFontOfSize(14);
            //section.Add(addEventElement);
            //addEventElement.Tapped += () =>
            //{
            //    if (OnNewEvent != null)
            //    {
            //        OnNewEvent(currentDate);
            //    }
            //};

            return new RootElement("") { section };
        }