public SpeakerEventCell (SpeakerEntity speaker) { this.Name = speaker.Name; this.DateRoom = ""; this.TwitterName = speaker.TwitterHandle; if (!string.IsNullOrEmpty (this.TwitterName)) { var twitterName = this.TwitterName.Replace ("@", ""); this.ImageUrl = "http://api.twitter.com/1/users/profile_image?screen_name=" + twitterName + "&size=bigger"; } this.Speaker = speaker; }
private void SetSpeaker (SpeakerEntity speaker) { Console.WriteLine("SpeakerBioLandscapeViewController.SetSpeaker - 1"); this.speakerNameLabel.Text = speaker.Name; this.speakerBioLabel.Text = " " + speaker.Biography; HLabel bioLabel; if (this.View.Subviews.Count () <= 10) { bioLabel = new HLabel (); } else { bioLabel = (HLabel)this.View.Subviews [10]; } bioLabel.VerticalAlignment = HLabel.VerticalAlignments.Top; bioLabel.Lines = 0; bioLabel.LineBreakMode = UILineBreakMode.WordWrap; if (!string.IsNullOrWhiteSpace (this.speakerBioLabel.Text)) { bioLabel.Text = this.speakerBioLabel.Text; } else { bioLabel.Text = " No information provided."; } bioLabel.Font = UIFont.FromName ("STHeitiTC-Light", 14); bioLabel.Frame = this.speakerBioLabel.Frame; bioLabel.BackgroundColor = UIColor.Clear; this.View.AddSubview (bioLabel); this.speakerBioLabel.Text = string.Empty; if (!string.IsNullOrWhiteSpace (speaker.BlogURL)) { this.speakerBlogImage.Hidden = false; this.speakerBlogButton.SetTitle (speaker.BlogURL, UIControlState.Normal); } else { this.speakerBlogImage.Hidden = true; this.speakerBlogButton.SetTitle (string.Empty, UIControlState.Normal); } if (!string.IsNullOrWhiteSpace (speaker.TwitterHandle)) { this.speakerTwitterImage.Hidden = false; this.speakerTwitterHandleButton.SetTitle (speaker.TwitterHandle, UIControlState.Normal); } else { this.speakerTwitterImage.Hidden = true; this.speakerTwitterHandleButton.SetTitle (string.Empty, UIControlState.Normal); } var sessions = GetSessionsForSpeaker (speaker); this.speakerSessionsTable.BackgroundColor = UIColor.Clear; this.speakerSessionsTable.ScrollEnabled = false; this.speakerSessionsTable.Delegate = new SpeakerBioLandscapeDelegate (this, sessions); this.speakerSessionsTable.DataSource = new SpeakerBioLandscapeDataSource (sessions); this.speakerSessionsTable.ReloadData (); if (!string.IsNullOrEmpty (speaker.TwitterHandle)) { var profileImage = "images/Profiles/" + speaker.TwitterHandle.Replace ("@", "") + ".png"; if (File.Exists (profileImage)) { UIImage image = UIImage.FromFile (profileImage); using (this.speakerProfileImage.Image) { image = Extensions.RemoveSharpEdges (image, Convert.ToInt32 (image.Size.Width), 4); this.speakerProfileImage.Image = image; } } } else if (File.Exists ("images/Profiles/" + speaker.Name.Replace (" ", "") + ".png")) { var profileImage = "images/Profiles/" + speaker.Name.Replace (" ", "") + ".png"; UIImage image = UIImage.FromFile (profileImage); using (this.speakerProfileImage.Image) { image = Extensions.RemoveSharpEdges (image, Convert.ToInt32 (image.Size.Width), 4); this.speakerProfileImage.Image = image; } } else { //var profileImage = "images/[email protected]"; var profileImage = "images/Profiles/DefaultUser.png"; UIImage image = UIImage.FromFile (profileImage); using (this.speakerProfileImage.Image) { image = Extensions.RemoveSharpEdges (image, Convert.ToInt32 (image.Size.Width), 4); this.speakerProfileImage.Image = image; } } }
public SpeakerBioLandscapeViewController (SpeakerEntity speaker) : base ("SpeakerBioLandscapeViewController", null) { Console.WriteLine("SpeakerBioLandscapeViewController.ctor - speaker"); _speaker = speaker; }
private List<SessionEntity> GetSessionsForSpeaker (SpeakerEntity speaker) { List<SessionEntity> sessions = null; if (UnitOfWork.IsUnitOfWorkStarted ()) { var repo = new LocalSessionsRepository (); sessions = repo.GetForSpeaker (speaker.SpeakerURI); } else { using (UnitOfWork.Start()) { var repo = new LocalSessionsRepository (); sessions = repo.GetForSpeaker (speaker.SpeakerURI); } } return sessions; }
public void SetSpeaker (SpeakerEntity speaker) { _speaker = speaker; }