public void Render(IRenderContext ctx) { var splitAt = ctx.Height / 2; if (top is ILayout layout && layout.DesiredHeight < splitAt) { splitAt = layout.DesiredHeight; } if (border.HasValue) { ctx.JoinLeftRight(splitAt, border.Value); } var innerTop = ctx.Scope(0, 0, ctx.Width, splitAt, Side.NotBottom); top.Render(innerTop); var b = (border.HasValue ? 1 : 0); var innerBottom = ctx.Scope(0, splitAt + b, ctx.Width, ctx.Height - splitAt - b, Side.NotTop); bottom.Render(innerBottom); if (border.HasValue) { for (int i = 0; i < ctx.Width; i++) { var c = BoxArt.Get(innerTop.GetJoinBottom(i), border.Value, innerBottom.GetJoinTop(i), border.Value); ctx.Put(i, splitAt, c);; } } }
public void Render(IRenderContext ctx) { var splitAt = ctx.Width / 2; if (left is ILayout layout && layout.DesiredWidth < splitAt) { splitAt = layout.DesiredWidth; } if (border.HasValue) { ctx.JoinTopDown(splitAt, border.Value); } var innerLeft = ctx.Scope(0, 0, splitAt, ctx.Height, Side.NotRight); left.Render(innerLeft); var b = (border.HasValue ? 1 : 0); var innerRight = ctx.Scope(splitAt + b, 0, ctx.Width - splitAt - b, ctx.Height, Side.NotLeft); right.Render(innerRight); if (border.HasValue) { for (int i = 0; i < ctx.Height; i++) { var c = BoxArt.Get(border.Value, innerRight.GetJoinLeft(i), border.Value, innerLeft.GetJoinRight(i)); ctx.Put(splitAt, i, c);; } } }
public void Render(IRenderContext ctx) { const BorderType none = BorderType.None; IRenderContext inner = null; var width = ctx.Width - 1; var height = ctx.Height - 1; if (content != null) { inner = ctx.Scope(1, 1, ctx.Width - 2, ctx.Height - 2); content.Render(inner); } ctx.Put(0, 0, border.TopLeftCorner); ctx.Put(width, 0, border.TopRightCorner); ctx.Put(0, height, border.BottomLeftCorner); ctx.Put(width, height, border.BottomRightCorner); for (var x = 1; x < width; ++x) { ctx.Put(x, 0, BoxArt.Get(none, borderType, inner?.GetJoinTop(x - 1) ?? BorderType.None, borderType)); ctx.Put(x, height, BoxArt.Get(inner?.GetJoinBottom(x - 1) ?? BorderType.None, borderType, none, borderType)); } for (var y = 1; y < height; ++y) { ctx.Put(0, y, BoxArt.Get(borderType, inner?.GetJoinLeft(y - 1) ?? BorderType.None, borderType, none)); ctx.Put(width, y, BoxArt.Get(borderType, none, borderType, inner?.GetJoinRight(y - 1) ?? BorderType.None)); } }
public static BoxArt BoxArts(int movieID) { MovieDbContext db = new MovieDbContext(); BoxArt boxArts = new BoxArt(); var boxArtList = db.BoxArts.Where( item => item.movie_ID == movieID).ToList(); boxArts = boxArtList[0]; return(boxArts); }
public static Title ParseTitle(XElement titleElement) { Title title = new Title(); XElement propertiesElement = titleElement.Element(MetadataNodeNames.Properties); title.Name = propertiesElement.Element(DataServiceNodeNames.Name).Value; title.ShortName = propertiesElement.Element(DataServiceNodeNames.ShortName).Value; title.Synopsis = propertiesElement.Element(DataServiceNodeNames.Synopsis).Value; title.ShortSynopsis = propertiesElement.Element(DataServiceNodeNames.ShortSynopsis).Value; BoxArt boxArt = new BoxArt(); XElement boxArtElement = propertiesElement.Element(DataServiceNodeNames.BoxArt); boxArt.SmallUrl = new Uri(boxArtElement.Element(DataServiceNodeNames.SmallUrl).Value); boxArt.MediumUrl = new Uri(boxArtElement.Element(DataServiceNodeNames.MediumUrl).Value); boxArt.LargeUrl = new Uri(boxArtElement.Element(DataServiceNodeNames.LargeUrl).Value); title.BoxArt = boxArt; return title; }
public static BoxArt CreateMovieBoxart(int movieID, Title title) { BoxArt boxArt = new BoxArt { movie_ID = movieID, boxart_38 = title.BoxArt38, boxart_64 = title.BoxArt64, boxart_110 = title.BoxArt110, boxart_124 = title.BoxArt124, boxart_150 = title.BoxArt150, boxart_166 = title.BoxArt166, boxart_88 = title.BoxArt88, boxart_197 = title.BoxArt197, boxart_176 = title.BoxArt176, boxart_284 = title.BoxArt284, boxart_210 = title.BoxArt210 }; return(boxArt); }
partial void OnBoxArtChanging(BoxArt value);
public static Title CreateTitle(string ID, global::System.DateTime dateModified, string type, BoxArt boxArt, string shortName, string name, InstantAvailability instant, DeliveryFormatAvailability dvd, DeliveryFormatAvailability bluRay, string tinyUrl, string netflixApiId) { Title title = new Title(); title.Id = ID; title.DateModified = dateModified; title.Type = type; if ((boxArt == null)) { throw new global::System.ArgumentNullException("boxArt"); } title.BoxArt = boxArt; title.ShortName = shortName; title.Name = name; if ((instant == null)) { throw new global::System.ArgumentNullException("instant"); } title.Instant = instant; if ((dvd == null)) { throw new global::System.ArgumentNullException("dvd"); } title.Dvd = dvd; if ((bluRay == null)) { throw new global::System.ArgumentNullException("bluRay"); } title.BluRay = bluRay; title.TinyUrl = tinyUrl; title.NetflixApiId = netflixApiId; return title; }
public static Title CreateTitle(string ID, global::System.DateTime dateModified, DeliveryFormatAvailability bluRay, BoxArt boxArt, DeliveryFormatAvailability dvd, InstantAvailability instant) { Title title = new Title(); title.Id = ID; title.DateModified = dateModified; if ((bluRay == null)) { throw new global::System.ArgumentNullException("bluRay"); } title.BluRay = bluRay; if ((boxArt == null)) { throw new global::System.ArgumentNullException("boxArt"); } title.BoxArt = boxArt; if ((dvd == null)) { throw new global::System.ArgumentNullException("dvd"); } title.Dvd = dvd; if ((instant == null)) { throw new global::System.ArgumentNullException("instant"); } title.Instant = instant; return title; }