Hi,
I have a algorithmic problem.
I am writing an application in .net (c#). First of all a small snippet:
var apps = new List<string>() { "app1", "app2", "app3" }; var colors = new List<Color>() { Colors.Green, Colors.Yellow, Colors.Red}; var possibilities = apps.SelectMany(app => colors, (app, color) => new ImageColorCombination(app, color)).ToList(); // missing logic // classes public class Image{ public List<ImageColorCombination> Parts {get;set;} } public class ImageColorCombination { public String Name{get;set;} public Color Color{get;set;} }
I want to create a statusbar. Showing the status (red, yellow, green) for each app. The mail problem is, that there is no way to create the full image (merged all 3 app images) at runtime. so i have to create all possible images before. later on i only want to open the pre-generated files if the status of a specific app has changed.
I hope you understand my problem.
I know this is not the best style but the only possiblity cause i have no ui thread to create the status bar on the fly. It is also not the best way to generate so many images but like i said there is no other way in this project.
So i hope you can help me with this problem.
The result should be:
1. Image: app1 (red) app2 (red) app3 (red)
2. Image: app1 (yellow) app2 (yellow) app3 (yellow)
3. Image: app1 (green) app2 (green) app3 (green)
4. Image: app1 (green) app2 (green) app3 (yellow)
...
n. Image: app1 (green) app2 (green) app3 (red)
One Image for each possible combination.
Windows, SharePoint, jQuery, knockout.js, etc. - All known technologies, but please mark posts as answered where appropriate ;)