本文整理汇总了C#中System.Resources.ResourceManager.GetStream方法的典型用法代码示例。如果您正苦于以下问题:C# System.Resources.ResourceManager.GetStream方法的具体用法?C# System.Resources.ResourceManager.GetStream怎么用?C# System.Resources.ResourceManager.GetStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Resources.ResourceManager
的用法示例。
在下文中一共展示了System.Resources.ResourceManager.GetStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AboutBox
public AboutBox()
{
InitializeComponent();
loc = label1.Location;
label1.Text = "";
try
{
var rm = new System.Resources.ResourceManager("BizHawk.Client.EmuHawk.Properties.Resources", GetType().Assembly);
sfx = new SoundPlayer(rm.GetStream("nothawk"));
sfx.Play();
}
catch
{
}
//panel1.Size = new System.Drawing.Size(1000, 1000);
//pictureBox5.GetType().GetMethod("SetStyle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.InvokeMethod).Invoke(pictureBox5, new object[] { ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true });
pictureBox5.BackColor = Color.Transparent;
pictureBox5.SendToBack();
pictureBox3.BringToFront();
pictureBox2.BringToFront();
pictureBox1.BringToFront();
pictureBox5.Visible = false;
}
示例2: Setup
public void Setup()
{
var manager = new System.Resources.ResourceManager("OpenLocationCode.Test.g", GetType().Assembly);
using (var sr = new System.IO.StreamReader(manager.GetStream("data/v1/shortcodetests.csv")))
{
string line = null;
do
{
line = sr.ReadLine();
if (string.IsNullOrEmpty(line) == false)
{
if (line.StartsWith("#")) continue;
TestDataV1List.Add(new ShortFullV1DataItem(line));
}
}
while (string.IsNullOrEmpty(line) == false);
}
using (var sr = new System.IO.StreamReader(manager.GetStream("data/vnext/shortcodetests.csv")))
{
string line = null;
do
{
line = sr.ReadLine();
if (string.IsNullOrEmpty(line) == false)
{
if (line.StartsWith("#")) continue;
TestDataVNextList.Add(new ShortFullVNextDataItem(line));
}
}
while (string.IsNullOrEmpty(line) == false);
}
}
示例3: WoW360Router
public WoW360Router()
{
InitializeComponent();
this.SetStyle(ControlStyles.UserPaint, true);
System.Resources.ResourceManager rm = new System.Resources.ResourceManager(
"DavidNikdel.Properties.Resources",
System.Reflection.Assembly.GetExecutingAssembly());
// load resources
m_controller = rm.GetObject("controller") as Bitmap;
m_about = rm.GetObject("about") as Bitmap;
m_keymap = rm.GetObject("keymap") as Bitmap;
m_chimeSnd = new SoundPlayer(rm.GetStream("ding"));
m_boopSnd = new SoundPlayer(rm.GetStream("boop"));
// load preferences
m_lookSensMulti = NORMAL_LOOK * m_settings.LookSensitivity;
m_mouseSensMulti = NORMAL_MOUSE * m_settings.MouseSensitivity;
m_home = new Vector2(m_settings.CenterOffsetX, m_settings.CenterOffsetY); // mouse center offset (in percent of quarter screen)
}
示例4: SoundInit
internal static void SoundInit()
{
var resources = new System.Resources.ResourceManager("Main.Resource", System.Reflection.Assembly.GetEntryAssembly());
sounds = new System.Media.SoundPlayer[13];
sounds[1] = new System.Media.SoundPlayer(resources.GetStream("missle"));
sounds[2] = new System.Media.SoundPlayer(resources.GetStream("magic_hit"));
sounds[4] = new System.Media.SoundPlayer(resources.GetStream("death"));
sounds[5] = new System.Media.SoundPlayer(resources.GetStream("sound_5"));
sounds[6] = new System.Media.SoundPlayer(resources.GetStream("hit"));
sounds[8] = new System.Media.SoundPlayer(resources.GetStream("miss"));
sounds[9] = new System.Media.SoundPlayer(resources.GetStream("step"));
sounds[10] = new System.Media.SoundPlayer(resources.GetStream("sound_10"));
sounds[12] = new System.Media.SoundPlayer(resources.GetStream("start_sound"));
}
示例5: GetResourceDictionary
/// <summary>
/// GetResourceDictionary
/// </summary>
public static ResourceDictionary GetResourceDictionary(string name)
{
var resourceName = name;
if (string.IsNullOrEmpty(resourceName)) { resourceName = "themes/generic.xaml"; }
ResourceDictionary retVal = null;
if (_resourceDictionaryCache.TryGetValue(resourceName, out retVal)) { return retVal; }
System.Reflection.Assembly assembly = typeof(ResourceManager).Assembly;
string baseName = string.Format("{0}.g", assembly.FullName.Split(new char[] { ',' })[0]);
string fullName = string.Format("{0}.resources", baseName);
foreach (string s in assembly.GetManifestResourceNames())
{
if (s == fullName)
{
System.Resources.ResourceManager manager = new System.Resources.ResourceManager(baseName, assembly);
System.Resources.ResourceSet set = manager.GetResourceSet(CultureInfo.InvariantCulture, true, true);
foreach (System.Collections.DictionaryEntry entry in set)
{
Console.WriteLine("{0} {1}", entry.Key, entry.Value);
}
using (System.IO.Stream stream = manager.GetStream(resourceName))
{
using (System.IO.StreamReader reader = new System.IO.StreamReader(stream))
{
retVal = System.Windows.Markup.XamlReader.Load(stream) as ResourceDictionary;//reader.ReadToEnd()
if (retVal != null)
{
_resourceDictionaryCache.Add(resourceName, retVal);
return retVal;
}
}
}
break;
}
}
return null;
}