Esempio n. 1
0
        public override void ViewDidLoad()
        {
            try {
                TitleLabel.Text = "CHOOSE EMAIL";
                TitleLabel.Font = Theme.HugeFont;

                //View.BackgroundColor = UIColor.Yellow;

                var items = new List <LcarsDef> ();

                var a      = new MonoTouch.AddressBook.ABAddressBook();
                var people = a.GetPeople();
                foreach (var p in people)
                {
                    var emails = p.GetEmails();

                    foreach (var e in emails)
                    {
                        var def = new LcarsDef();

                        var addr = e.Value;

                        def.Caption = addr;
                        def.Command = delegate { Choose(addr); };
                        items.Add(def);
                    }
                }

                var y = TitleLabel.Frame.Bottom + App.Inst.LabelGap;
                _select = new SelectItem(items, new RectangleF(TitleLabel.Frame.Left, y, View.Frame.Width, View.Frame.Height - y));
                View.AddSubview(_select);
            } catch (Exception error) {
                Log.Error(error);
            }
        }
Esempio n. 2
0
        public void RefreshInfo(UIInfo info)
        {
            TitleLabel.Text = info.ScreenTitle.ToUpperInvariant();
            PrimaryComp.Def = info.TopLeft;

            HomeBtn.Def = info.TopMisc;

            //
            // Did the buttons actually change?
            //
            var oldNumButtons = Defs == null ? 0 : Defs.Length;
            var numButtons    = info.CommandButtons != null ? info.CommandButtons.Length : 0;
            var sameButtons   = numButtons == oldNumButtons;

            if (sameButtons)
            {
                for (var i = 0; i < numButtons && sameButtons; i++)
                {
                    var a = Defs[i];
                    var b = info.CommandButtons[i];
                    sameButtons = a.Caption == b.Caption;
                }
            }

            Defs = info.CommandButtons;
            if (!sameButtons)
            {
                if (_buttons != null)
                {
                    _buttons.RemoveFromSuperview();
                    _buttons = null;
                }

                if (numButtons > 0)
                {
                    var w = 600;
                    var h = 160;
                    _buttons = new SelectItem(info.CommandButtons, new RectangleF(View.Frame.Width - w, TitleLabel.Frame.Bottom + 10, w, h), 100, 10, 0, ItemOrder.RightToLeft);
                    _buttons.BackgroundColor = UIColor.Clear;
                    View.AddSubview(_buttons);
                    DoLayout();
                }
            }

//			var leftButton = View.Frame.Width;
//			if (numButtons > 0) {
//				var b = buttons[numButtons - 1];
//				leftButton = b.Frame.Left;
//			}
//
//			MsgTable.Frame = new System.Drawing.RectangleF(MsgTable.Frame.Left,
//			                                               MsgTable.Frame.Top,
//			                                               leftButton - 20 - MsgTable.Frame.Left,
//			                                               MsgTable.Frame.Height);
//			MsgTable.Hidden = MsgTable.Frame.Width < 100;
        }
Esempio n. 3
0
        public override void ViewDidLoad()
        {
            try {
                TitleLabel.Font = Theme.HugeFont;
                sourceTypes = SourceTypes.All;

                var items = new List<LcarsDef> ();
                foreach (var sourceType in sourceTypes) {
                    var t = sourceType;
                    var def = new LcarsDef ();

                    def.Caption = SourceTypes.GetTitle (t);
                    def.Command = delegate { Choose (t); };
                    items.Add (def);
                }

                var y = TitleLabel.Frame.Bottom + App.Inst.LabelGap;
                _select = new SelectItem (items, new RectangleF (TitleLabel.Frame.Left, y, View.Frame.Width, View.Frame.Height - y));
                View.AddSubview (_select);
            } catch (Exception error) {
                Log.Error (error);
            }
        }
Esempio n. 4
0
        public override void ViewDidLoad()
        {
            try {
                TitleLabel.Font = Theme.HugeFont;
                sourceTypes     = SourceTypes.All;

                var items = new List <LcarsDef> ();
                foreach (var sourceType in sourceTypes)
                {
                    var t   = sourceType;
                    var def = new LcarsDef();

                    def.Caption = SourceTypes.GetTitle(t);
                    def.Command = delegate { Choose(t); };
                    items.Add(def);
                }

                var y = TitleLabel.Frame.Bottom + App.Inst.LabelGap;
                _select = new SelectItem(items, new RectangleF(TitleLabel.Frame.Left, y, View.Frame.Width, View.Frame.Height - y));
                View.AddSubview(_select);
            } catch (Exception error) {
                Log.Error(error);
            }
        }
Esempio n. 5
0
        public override void ViewDidLoad()
        {
            try {
                TitleLabel.Text = "CHOOSE EMAIL";
                TitleLabel.Font = Theme.HugeFont;

                //View.BackgroundColor = UIColor.Yellow;

                var items = new List<LcarsDef> ();

                var a = new MonoTouch.AddressBook.ABAddressBook ();
                var people = a.GetPeople ();
                foreach (var p in people) {

                    var emails = p.GetEmails ();

                    foreach (var e in emails) {
                        var def = new LcarsDef ();

                        var addr = e.Value;

                        def.Caption = addr;
                        def.Command = delegate { Choose (addr); };
                        items.Add (def);
                    }
                }

                var y = TitleLabel.Frame.Bottom + App.Inst.LabelGap;
                _select = new SelectItem (items, new RectangleF (TitleLabel.Frame.Left, y, View.Frame.Width, View.Frame.Height - y));
                View.AddSubview (_select);
            } catch (Exception error) {
                Log.Error (error);
            }
        }
Esempio n. 6
0
        public void RefreshInfo(UIInfo info)
        {
            TitleLabel.Text = info.ScreenTitle.ToUpperInvariant ();
            PrimaryComp.Def = info.TopLeft;

            HomeBtn.Def = info.TopMisc;

            //
            // Did the buttons actually change?
            //
            var oldNumButtons = Defs == null ? 0 : Defs.Length;
            var numButtons = info.CommandButtons != null ? info.CommandButtons.Length : 0;
            var sameButtons = numButtons == oldNumButtons;
            if (sameButtons) {
                for (var i = 0; i < numButtons && sameButtons; i++) {
                    var a = Defs[i];
                    var b = info.CommandButtons[i];
                    sameButtons = a.Caption == b.Caption;
                }
            }

            Defs = info.CommandButtons;
            if (!sameButtons) {
                if (_buttons != null) {
                    _buttons.RemoveFromSuperview ();
                    _buttons = null;
                }

                if (numButtons > 0) {
                    var w = 600;
                    var h = 160;
                    _buttons = new SelectItem (info.CommandButtons, new RectangleF (View.Frame.Width - w, TitleLabel.Frame.Bottom + 10, w, h), 100, 10, 0, ItemOrder.RightToLeft);
                    _buttons.BackgroundColor = UIColor.Clear;
                    View.AddSubview (_buttons);
                    DoLayout ();
                }
            }

            //			var leftButton = View.Frame.Width;
            //			if (numButtons > 0) {
            //				var b = buttons[numButtons - 1];
            //				leftButton = b.Frame.Left;
            //			}
            //
            //			MsgTable.Frame = new System.Drawing.RectangleF(MsgTable.Frame.Left,
            //			                                               MsgTable.Frame.Top,
            //			                                               leftButton - 20 - MsgTable.Frame.Left,
            //			                                               MsgTable.Frame.Height);
            //			MsgTable.Hidden = MsgTable.Frame.Width < 100;
        }