void IFilmOutlinable.SetInfo(NSTextField view) { view.AttributedStringValue = FilmInfo.InfoString(Film); view.LineBreakMode = NSLineBreakMode.ByWordWrapping; view.BackgroundColor = NSColor.Clear; view.TextColor = NSColor.Text; }
public override NSView GetViewForItem(NSTableView tableView, NSTableColumn tableColumn, nint row) { // Get the cell view NSTextField view = (NSTextField)tableView.MakeView(_cellIdentifier, this); // Get the data for the row Film film = _dataSource.Films[(int)row]; // Setup view based on the column selected switch (tableColumn.Title) { case "Film": NSTextField filmLabel = (NSTextField)view; PopulateFilm(ref filmLabel); filmLabel.StringValue = film.Title; tableColumn.Width = _titleWidth; return(filmLabel); case "Description": NSTextField descriptionLabel = (NSTextField)view; PopulateDescription(ref descriptionLabel); descriptionLabel.AttributedStringValue = FilmInfo.InfoString(film); return(descriptionLabel); case "Duration": NSTextField durationLabel = (NSTextField)view; PopulateDuration(ref durationLabel); durationLabel.StringValue = film.DurationString; durationLabel.TextColor = DurationTextColor(film.Duration); return(durationLabel); case "#Screenings": NSTextField screeningCountLabel = (NSTextField)view; PopulateScreeningCount(ref screeningCountLabel); int screeningCount = film.FilmScreenings.Count; screeningCountLabel.StringValue = screeningCount.ToString(); screeningCountLabel.TextColor = ScreeningCountTextColor(screeningCount); return(screeningCountLabel); case "Subsection": NSTextField subsectionLabel = (NSTextField)view; PupulateSubsection(ref subsectionLabel); subsectionLabel.StringValue = film.SubsectionName; subsectionLabel.TextColor = SubsectionTextColor(film); subsectionLabel.ToolTip = film.SubsectionDescription; return(subsectionLabel); default: if (ScreeningInfo.FilmFans.Contains(tableColumn.Title)) { RatingField friendRatingField = (RatingField)view; PopulateFilmFanFilmRating(ref friendRatingField, film, tableColumn.Title, row); friendRatingField.StringValue = ViewController.GetFilmFanFilmRating(film, tableColumn.Title).ToString(); friendRatingField.Tag = row; return(friendRatingField); } break; } return(view); }
public void SetInfo(NSTextField view) { ColorView.SetScreeningColor(Screening, view); switch (OutlineLevel) { case Level.OverlappingScreening: var attributedInfo = new NSMutableAttributedString(Screening.ScreeningStringForLabel() + " "); attributedInfo.Append(FilmInfo.InfoString(Screening.Film)); view.AttributedStringValue = attributedInfo; break; case Level.FilmScreening: view.StringValue = Screening.ScreeningStringForLabel(true); break; } view.LineBreakMode = NSLineBreakMode.TruncatingTail; }