|
using System;
using System.Resources;
using System.Configuration;
using System.Reflection;
using System.Drawing;
namespace CP.Apps.ScreenSaver
{
/// <summary>
/// A class that is used to extract resources
/// </summary>
public class Res
{
private static ResourceManager resMgr;
private static string imageManifestName = "CP.Apps.ScreenSaver.Images.";
static Res()
{
//Allow for localization in future
Assembly assembly = Assembly.GetExecutingAssembly();
resMgr = new ResourceManager("CP.Apps.ScreenSaver.CPRama", assembly);
}
public static string GetString(string name)
{
return resMgr.GetString(name);
}
public static Image GetImage(string name)
{
Assembly assembly = Assembly.GetExecutingAssembly();
return Image.FromStream(assembly.GetManifestResourceStream(imageManifestName + name));
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.