public static Dictionary<string, string> GetCurrentImageSelections(string id, Dictionary<string,string> images, List<string> items, string type)
{
var blobname = type + "_images.json";
var hub_selections = new Dictionary<string, string>();
var hub_uri = BlobStorage.MakeAzureBlobUri(id, blobname); // look for hub images
if (BlobStorage.ExistsBlob(id, blobname))
hub_selections = GetSelections(hub_uri);
var global_selections = new Dictionary<string,string>();
var global_uri = BlobStorage.MakeAzureBlobUri("admin", blobname); // acquire global images
global_selections = GetSelections(global_uri);
foreach (var item in items)
{
if (hub_selections.ContainsKey(item) == false) // nothing selected for category or source
hub_selections[item] = NoCurrentImageUrl; // force default selection
if ( hub_selections[item] == NoCurrentImageUrl ) // if unassigned check for global assignment
{
if ( global_selections.ContainsKey(item) )
hub_selections[item] = global_selections[item];
}
}
return hub_selections;
}