Exemple #1
0
        public void Set(string name, UIImage img, string time, UIImage actionImage,
                        NSMutableAttributedString header, NSMutableAttributedString body,
                        OHAttributedLabelDelegate headerDelegate, OHAttributedLabelDelegate bodyDelegate,
                        IEnumerable <Link> headerLinks, IEnumerable <Link> bodyLinks)
        {
            this.Image.Image       = img;
            this.Time.Text         = time;
            this.ActionImage.Image = actionImage;

            if (header == null)
            {
                header = new NSMutableAttributedString();
            }
            if (body == null)
            {
                body = new NSMutableAttributedString();
            }

            this.Header.AttributedText = header;
            this.Body.AttributedText   = body;
            this.Body.Hidden           = body.Length == 0;

            this.Header.RemoveAllCustomLinks();
            this.Body.RemoveAllCustomLinks();
            this.Header.Delegate = headerDelegate;
            this.Body.Delegate   = bodyDelegate;

            foreach (var b in headerLinks)
            {
                this.Header.AddCustomLink(new NSUrl(b.Id.ToString()), b.Range);
            }

            foreach (var b in bodyLinks)
            {
                this.Body.AddCustomLink(new NSUrl(b.Id.ToString()), b.Range);
            }
        }
        public void Set(string name, UIImage img, string time, UIImage actionImage, 
            NSMutableAttributedString header, NSMutableAttributedString body, 
            OHAttributedLabelDelegate headerDelegate, OHAttributedLabelDelegate bodyDelegate,
            IEnumerable<Link> headerLinks, IEnumerable<Link> bodyLinks)
        {
            this.Image.Image = img;
            this.Time.Text = time;
            this.ActionImage.Image = actionImage;

            if (header == null)
                header = new NSMutableAttributedString();
            if (body == null)
                body = new NSMutableAttributedString();

            this.Header.AttributedText = header;
            this.Body.AttributedText = body;
            this.Body.Hidden = body.Length == 0;

            this.Header.RemoveAllCustomLinks();
            this.Body.RemoveAllCustomLinks();
            this.Header.Delegate = headerDelegate;
            this.Body.Delegate = bodyDelegate;

            foreach (var b in headerLinks)
                this.Header.AddCustomLink(new NSUrl(b.Id.ToString()), b.Range);

            foreach (var b in bodyLinks)
                this.Body.AddCustomLink(new NSUrl(b.Id.ToString()), b.Range);
        }