当前位置: 首页>>代码示例>>C#>>正文


C# System.Resources.ResourceManager.GetStream方法代码示例

本文整理汇总了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;
        }
开发者ID:cas1993per,项目名称:bizhawk,代码行数:25,代码来源:AboutBox.cs

示例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);
            }
        }
开发者ID:DVDpro,项目名称:open-location-code,代码行数:33,代码来源:ShortFullTest.cs

示例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)
        }
开发者ID:glenstevens,项目名称:wow360,代码行数:20,代码来源:WoW360Router.cs

示例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"));
        }
开发者ID:gowantervo,项目名称:coab,代码行数:16,代码来源:seg044.cs

示例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;
 }
开发者ID:zebulon75018,项目名称:photochoicetouch,代码行数:39,代码来源:DateSelector.cs


注:本文中的System.Resources.ResourceManager.GetStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。