Choose a good image at the start of the window being opened.

This commit is contained in:
2017-09-20 14:18:00 -05:00
parent 4911a787d4
commit 59bea020b6
2 changed files with 32 additions and 0 deletions

View File

@ -8,6 +8,7 @@ using System.Xml;
using System.Xml.Serialization;
using System.Resources;
using System.IO;
using System.Collections;
namespace SpriteLibrary
{
@ -203,6 +204,25 @@ namespace SpriteLibrary
return MyImage;
}
/// <summary>
/// Return a list of the image names in the Properties.Resources
/// </summary>
/// <returns></returns>
public List<string> GetImageNames()
{
List<string> Names = new List<string>();
if (myResourceManager == null) return Names;
ResourceSet Rs = myResourceManager.GetResourceSet(System.Globalization.CultureInfo.CurrentCulture, true, true);
foreach (DictionaryEntry entry in Rs)
{
string resourceKey = entry.Key.ToString(); //The name
object resource = entry.Value; //The object itself
if (resource is Image) Names.Add(resourceKey);
}
return Names;
}
/// <summary>
/// This code is mostly handled by the sprite controller. If the SpriteController has a SpriteDatabase
/// registered, then it will automatically ask the SpriteDatabase to create any sprite it does not already