public UIView[] BuildForPublished(Match match, int verticalOffset) { var homeRealScore = match.HomeRealScore.HasValue ? match.HomeRealScore.Value.ToString() : ""; var guestRealScore = match.GuestRealScore.HasValue ? match.GuestRealScore.Value.ToString() : ""; UIColor[] homeResultColor = _GetColorForUserResult(match.HomeRealScore, match.HomeUserScore); UIColor[] guestResultColor = _GetColorForUserResult(match.GuestRealScore, match.GuestUserScore); UIColor[] gameResultColor = _GetColorForGameResult(match.HomeRealScore, match.HomeUserScore, match.GuestRealScore , match.GuestUserScore); return new UIView[] { _BuildLabel(new RectangleF(5, verticalOffset, 100, 24), match.HomeTeam, UIColor.Clear, false), new FrameView() { StrokeColor = homeResultColor[1], Frame = new RectangleF(110, verticalOffset, 25, 24)}, _BuildLabel(new RectangleF(110, verticalOffset, 25, 24), (match.HomeUserScore.HasValue) ? match.HomeUserScore.Value.ToString() : "", homeResultColor[0], true), new FrameView() { StrokeColor = gameResultColor[1], Frame = new RectangleF(140, verticalOffset, 40, 24)}, _BuildLabel(new RectangleF(140, verticalOffset, 40, 24), string.Format("{0}-{1}", homeRealScore, guestRealScore), gameResultColor[0], true), new FrameView() { StrokeColor = guestResultColor[1], Frame = new RectangleF(185, verticalOffset, 25, 24)}, _BuildLabel(new RectangleF(185, verticalOffset, 25, 24), (match.GuestUserScore.HasValue) ? match.GuestUserScore.Value.ToString() : "", guestResultColor[0], true), _BuildLabel(new RectangleF(215, verticalOffset, 100, 24), match.GuestTeam, UIColor.Clear, false) }; }
public UIView[] BuildForReadOnly(Match match, int verticalOffset) { var homeRealScore = match.HomeRealScore.HasValue ? match.HomeRealScore.Value.ToString() : ""; var guestRealScore = match.GuestRealScore.HasValue ? match.GuestRealScore.Value.ToString() : ""; return new UIView[] { _BuildLabel(new RectangleF(5, verticalOffset, 100, 24), match.HomeTeam, UIColor.Clear, false), new FrameView() { StrokeColor = UIColor.Gray, Frame = new RectangleF(110-2, verticalOffset, 25+4, 24)}, _BuildLabel(new RectangleF(110, verticalOffset+2, 25, 24-4), (match.HomeUserScore.HasValue) ? match.HomeUserScore.Value.ToString() : "", UIColor.White, true), _BuildLabel(new RectangleF(140, verticalOffset, 40, 24), string.Format("{0}-{1}", homeRealScore, guestRealScore), UIColor.FromRGBA(222/255f, 222/255f, 225/255f, 0.25f), true), new FrameView() { StrokeColor = UIColor.Gray, Frame = new RectangleF(185-2, verticalOffset, 25+4, 24)}, _BuildLabel(new RectangleF(185, verticalOffset+2, 25, 24-4), (match.GuestUserScore.HasValue) ? match.GuestUserScore.Value.ToString() : "", UIColor.White, true), _BuildLabel(new RectangleF(215, verticalOffset, 100, 24), match.GuestTeam, UIColor.Clear, false), }; }