private static string AddDetails(string htmlpath, string imagePath, string name) { Directory.CreateDirectory(imagePath); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"<hr/>"); stringBuilder.AppendLine($"<h2>{name}</h2>"); string path = $@"F:\Trains\eWolfModelRailwayWeb\Data\Catalog\{name}"; List <string> images = ImageHelper.GetAllImages(path); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } } } stringBuilder.AppendLine("</div></div>"); return(stringBuilder.ToString()); }
private static string AddDetails(string htmlpath, string imagePath, string name) { Directory.CreateDirectory(imagePath); eWolfBootstrap.Interfaces.IPageBuilder pageBuilder = new PageBuilder(); pageBuilder.Append($"<hr/>"); pageBuilder.Append($"<h2>{name}</h2>"); string path = Constants.RawDataPath + $@"Catalog\{name}"; List <string> images = ImageHelper.GetAllImages(path); pageBuilder.Append("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, pageBuilder, layoutImage); if (count-- == 0) { count = 2; pageBuilder.Append("</div></div>"); pageBuilder.Append("<div class='container mt-4'><div class='row'>"); } } } pageBuilder.Append("</div></div>"); return(pageBuilder.GetString()); }
private static string AddLayoutDetails_005(string htmlpath, string imagePath) { Directory.CreateDirectory(imagePath); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"<hr/>"); stringBuilder.AppendLine("<h2>I see grass! (Shelf display)</h2>"); stringBuilder.AppendLine("<p>Final added some grass, shrubs and fences to my Shelf display</p>"); string path = @"F:\Trains\eWolfModelRailwayWeb\Data\MyLayout\2020-05-11 Hills are green\"; List <string> images = ImageHelper.GetAllImages(path); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } } } stringBuilder.AppendLine("</div></div>"); return(stringBuilder.ToString()); }
private static string AddLayoutDetails_001(string htmlpath, string imagePath) { Directory.CreateDirectory(imagePath); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"<hr/>"); stringBuilder.AppendLine("<h2>Layout ideas(Shunting yard)</h2>Backdated :19/01/2020"); stringBuilder.AppendLine("<p>For the Shunting yard, I played around with many track layouts, just by laying track down on the surface to see how it will look.</p>"); stringBuilder.AppendLine("<p>Here are some of them...</p>"); string path = @"F:\Trains\eWolfModelRailwayWeb\Data\MyLayout\001-Track Ideas\"; List <string> images = ImageHelper.GetAllImages(path); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } } } stringBuilder.AppendLine("</div></div>"); return(stringBuilder.ToString()); }
private static string AddLayoutDetails_002(string htmlpath, string imagePath) { Directory.CreateDirectory(imagePath); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"<hr/>"); stringBuilder.AppendLine("<h2>Final Plan (Shunting yard)</h2>Backdated :09/02/2020"); stringBuilder.AppendLine("<p>I've picked my final plan. It's got a main straight line for through traffic, a yard for shunting and a area for a shed.</p>"); stringBuilder.AppendLine("<p>But still a lot of space for some nice scenery.</p>"); string path = @"F:\Trains\eWolfModelRailwayWeb\Data\MyLayout\002-Layout\"; List <string> images = ImageHelper.GetAllImages(path); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } } } stringBuilder.AppendLine("</div></div>"); return(stringBuilder.ToString()); }
private static string AddLayoutDetails_003(string htmlpath, string imagePath) { Directory.CreateDirectory(imagePath); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"<hr/>"); stringBuilder.AppendLine("<h2>It's been a while (Shelf display)</h2>"); stringBuilder.AppendLine("<p>Ok, I've final remembered to take some photo and upload them.</p>"); stringBuilder.AppendLine("<p>Here are some image of my Shelf display, it's just a static scene to have a nice place to put locos on and leave them on display.</p>"); stringBuilder.AppendLine("<p>next will be the bridge and track along the top.</p>"); string path = @"F:\Trains\eWolfModelRailwayWeb\Data\MyLayout\003-HillsAndTrack\"; List <string> images = ImageHelper.GetAllImages(path); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } } } stringBuilder.AppendLine("</div></div>"); return(stringBuilder.ToString()); }
private static void AddImagesByLayout(List <string> images, IModelEvent pageDetails, string htmlpath, string imagePath, StringBuilder stringBuilder) { bool any = false; int count = 2; foreach (Data.LayoutDetails layout in pageDetails.Layouts) { if (!layout.ImagePaths.Any()) { continue; } stringBuilder.AppendLine("</div>"); stringBuilder.Append($"<hr/><h2><a id='{layout.IDName}'> {layout.Name}</a></h2>"); stringBuilder.AppendLine("<div class='row'>"); count = 2; foreach (string layoutImage in layout.ImagePaths) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } any = true; images.Remove(layoutImage); } } } if (images.Any()) { count = 2; if (any) { stringBuilder.AppendLine("</div>"); stringBuilder.Append("<hr/><h4>Others</h4>"); stringBuilder.AppendLine("<div class='row'>"); } foreach (string image in images) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, image); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div>"); stringBuilder.AppendLine("</div>"); stringBuilder.AppendLine("<div class='container mt-4'>"); stringBuilder.AppendLine("<div class='row'>"); } } } }
private static string AddLayoutDetails_004(string htmlpath, string imagePath) { Directory.CreateDirectory(imagePath); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"<hr/>"); stringBuilder.AppendLine("<h2>Home running</h2>"); stringBuilder.AppendLine("<p>Testing our trains out on the floor, lets us play with some ideas for the layout. Managed to gets some of my Dads rolling stock running as well.</p>"); stringBuilder.AppendLine("<p>You can see I ran out of straight and had to use curve track for the sidings :)</p>"); string path = @"F:\Trains\eWolfModelRailwayWeb\Data\MyLayout\2020-04-18 Running\"; List <string> images = ImageHelper.GetAllImages(path); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } } } stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='col-md-8'>"); string youTubeLink = "https://www.youtube.com/embed/UizKwGgh1TA"; stringBuilder.AppendLine("<div class='embed-responsive embed-responsive-16by9'>"); stringBuilder.AppendLine($"<iframe src='{youTubeLink}' allow='accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"); stringBuilder.AppendLine("</div>"); stringBuilder.AppendLine("</div>"); return(stringBuilder.ToString()); }
private static string AddHalt_001(string htmlpath, string imagePath) { Directory.CreateDirectory(imagePath); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"<hr/>"); stringBuilder.AppendLine("<h2>First trip to Rushcliffe Halt featuring a class 66</h2> 26/06/2020"); string path = @"F:\Trains\eWolfModelRailwayWeb\Data\Stations\Rushcliffe Halt\2020-06-26\"; stringBuilder.AppendLine("<div class='col-md-8'>"); string youTubeLink = "https://www.youtube.com/embed/NemRaAwWhms"; stringBuilder.AppendLine("<div class='embed-responsive embed-responsive-16by9'>"); stringBuilder.AppendLine($"<iframe src='{youTubeLink}' allow='accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"); stringBuilder.AppendLine("</div>"); stringBuilder.AppendLine("</div>"); List <string> images = ImageHelper.GetAllImages(path); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); int count = 2; foreach (string layoutImage in images) { if (images.Contains(layoutImage)) { HTMLHelper.AddImageToPage(htmlpath, imagePath, stringBuilder, layoutImage); if (count-- == 0) { count = 2; stringBuilder.AppendLine("</div></div>"); stringBuilder.AppendLine("<div class='container mt-4'><div class='row'>"); } } } stringBuilder.AppendLine("</div></div>"); return(stringBuilder.ToString()); }