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


C# ResourceManager.GetObject方法代码示例

本文整理汇总了C#中System.Resources.ResourceManager.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.GetObject方法的具体用法?C# ResourceManager.GetObject怎么用?C# ResourceManager.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Resources.ResourceManager的用法示例。


在下文中一共展示了ResourceManager.GetObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeComponent

 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
         System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Splash));
         this.pictureBox1 = new System.Windows.Forms.PictureBox();
         this.timer1 = new System.Windows.Forms.Timer(this.components);
         this.SuspendLayout();
         //
         // pictureBox1
         //
         this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
         this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image")));
         this.pictureBox1.Name = "pictureBox1";
         this.pictureBox1.Size = new System.Drawing.Size(632, 416);
         this.pictureBox1.TabIndex = 0;
         this.pictureBox1.TabStop = false;
         //
         // Splash
         //
         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.ClientSize = new System.Drawing.Size(632, 416);
         this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                       this.pictureBox1});
         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         this.Name = "Splash";
         this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
         this.Text = "Splash";
         this.ResumeLayout(false);
 }
开发者ID:mymindleaks,项目名称:dX---discover-and-eXplore,代码行数:33,代码来源:Splash.cs

示例2: addToolButton

        public void addToolButton(FormMain formMain)
        {
            this.formMain = formMain;
            var rm = new ResourceManager("PluginExportScreens.Icon", this.GetType().Assembly);

            var iconImport = (System.Drawing.Bitmap)rm.GetObject("icon_import");
            var item = new ToolStripButton("Import", iconImport, btImport_Click);
            item.DisplayStyle = ToolStripItemDisplayStyle.Image;
            formMain.addToolButton(item);

            var iconExportPic = (System.Drawing.Bitmap)rm.GetObject("icon_export");
            item = new ToolStripButton("Export pic", iconExportPic, bttExportPic_Click);
            item.DisplayStyle = ToolStripItemDisplayStyle.Image;
            formMain.addToolButton(item);

            var iconExportJson = (System.Drawing.Bitmap)rm.GetObject("icon_export");
            item = new ToolStripButton("Export json", iconExportJson, bttExportJson_Click);
            item.DisplayStyle = ToolStripItemDisplayStyle.Image;
            formMain.addToolButton(item);

            var iconExport = (System.Drawing.Bitmap)rm.GetObject("icon_export");
            item = new ToolStripButton("Export", iconExport, btExport_Click);
            item.DisplayStyle = ToolStripItemDisplayStyle.Image;
            formMain.addToolButton(item);
        }
开发者ID:ghostdogtm,项目名称:CadEditor,代码行数:25,代码来源:PluginExportScreens.cs

示例3: GetIconFromResx

        public static Image GetIconFromResx(string iconname)
        {
            Image image;
            //get resource
            Assembly myAssem = Assembly.GetEntryAssembly();
            ResourceManager rm = new ResourceManager(typeof(Johnny.Controls.Windows.Toolbox.MyResource));

            if (rm == null)
                return null;

            switch (iconname)
            {
                case ToolboxConstants.ICON_PLUS:
                    image = (Image)rm.GetObject(ToolboxConstants.ICON_PLUS);
                    break;
                case ToolboxConstants.ICON_MINUS:
                    image = (Image)rm.GetObject(ToolboxConstants.ICON_MINUS);
                    break;
                default:
                    image = null;
                    break;
            }

            return image;
        }
开发者ID:jojozhuang,项目名称:Projects,代码行数:25,代码来源:IconCtrl.cs

示例4: InitializeComponent

 private void InitializeComponent()
 {
     ResourceManager manager = new ResourceManager(typeof(SystemHintForm));
     this.picClose = new PictureBox();
     this.pictureBox1 = new PictureBox();
     this.label1 = new Label();
     this.lblHintText = new Label();
     base.SuspendLayout();
     this.picClose.Anchor = AnchorStyles.Right | AnchorStyles.Top;
     this.picClose.Cursor = Cursors.Hand;
     this.picClose.Image = (Image) manager.GetObject("picClose.Image");
     this.picClose.Location = new Point(0xee, 3);
     this.picClose.Name = "picClose";
     this.picClose.Size = new Size(0x13, 0x11);
     this.picClose.SizeMode = PictureBoxSizeMode.StretchImage;
     this.picClose.TabIndex = 3;
     this.picClose.TabStop = false;
     this.picClose.Click += new EventHandler(this.picClose_Click);
     this.pictureBox1.Cursor = Cursors.Hand;
     this.pictureBox1.Image = (Image) manager.GetObject("pictureBox1.Image");
     this.pictureBox1.Location = new Point(4, 3);
     this.pictureBox1.Name = "pictureBox1";
     this.pictureBox1.Size = new Size(0x13, 0x11);
     this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex = 4;
     this.pictureBox1.TabStop = false;
     this.label1.AutoSize = true;
     this.label1.BackColor = Color.Transparent;
     this.label1.Font = new Font("宋体", 9f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
     this.label1.ForeColor = Color.Blue;
     this.label1.Location = new Point(0x18, 6);
     this.label1.Name = "label1";
     this.label1.Size = new Size(0x36, 0x11);
     this.label1.TabIndex = 5;
     this.label1.Text = "系统提示";
     this.lblHintText.BackColor = Color.Transparent;
     this.lblHintText.ForeColor = Color.Magenta;
     this.lblHintText.Location = new Point(0x18, 0x20);
     this.lblHintText.Name = "lblHintText";
     this.lblHintText.Size = new Size(0xd8, 0xb0);
     this.lblHintText.TabIndex = 6;
     this.AutoScaleBaseSize = new Size(5, 13);
     base.ClientSize = new Size(260, 0xe8);
     base.Controls.Add(this.lblHintText);
     base.Controls.Add(this.label1);
     base.Controls.Add(this.pictureBox1);
     base.Controls.Add(this.picClose);
     base.Delay = 0xbb8;
     base.Location = new Point(0, 650);
     base.Name = "SystemHintForm";
     base.SizeGripStyle = SizeGripStyle.Hide;
     base.Speed = 0x23;
     base.StartLocation = new Point(0, 650);
     base.StartPosition = FormStartPosition.Manual;
     this.Text = "";
     base.ResumeLayout(false);
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:57,代码来源:SystemHintForm.cs

示例5: LoadLayouts

		public void LoadLayouts ()
		{
			ResourceManager	rm;
			rm = new ResourceManager ("keyboards", System.Reflection.Assembly.GetExecutingAssembly());
			keyboard_layouts = (KeyboardLayout []) rm.GetObject ("keyboard_table");

			vkey_table = (int [][]) rm.GetObject ("vkey_table");
			scan_table = (short [][]) rm.GetObject ("scan_table");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:KeyboardLayouts.cs

示例6: Init

 public void Init()
 {
     var asm = System.Reflection.Assembly.GetExecutingAssembly();
     var rm = new ResourceManager("DaocClientLib.Test.Properties.testpcxressources", asm);
     PCX24 = (byte[])rm.GetObject("grid24");
     PCX8 = (byte[])rm.GetObject("grid8");
     PCX24RLE = (byte[])rm.GetObject("grid24rle");
     PCX8RLE = (byte[])rm.GetObject("grid8rle");
 }
开发者ID:dol-leodagan,项目名称:DaocClientLib,代码行数:9,代码来源:PCXDecoderTest.cs

示例7: Resources

 static Resources()
 {
     Assembly assembly = Assembly.GetExecutingAssembly();
     string[] strings = assembly.GetManifestResourceNames();
     ResourceManager resources = new ResourceManager("ScoreKeeper.Resources",
                                                     assembly);
     Icon = (Icon)resources.GetObject("Icon");
     FllLogo = (Image)resources.GetObject("FLL Logo");
     FllEventLogo = (Image)resources.GetObject("FLL Event Logo");
 }
开发者ID:mnedelman,项目名称:scorer,代码行数:10,代码来源:Resources.cs

示例8: Expander

		internal Expander(ChartObject item) : base(item)
		{
			if (imgExpanded == null || imgCollapsed == null)
			{
				ResourceManager rm = new ResourceManager(
					"MindFusion.FlowChartX.Icons", this.GetType().Assembly);
				imgExpanded = (Icon)rm.GetObject("mnp_collapse");
				imgCollapsed = (Icon)rm.GetObject("mnp_expand");
			}
		}
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:10,代码来源:Expander.cs

示例9: MainFrm

 public MainFrm()
 {
     InitializeComponent();
     ResourceManager resourceManager = new ResourceManager("Loader.Indicator", typeof(MainFrm).Assembly);
     BoxR = (Icon)resourceManager.GetObject("Boxr");
     BoxO = (Icon)resourceManager.GetObject("Boxo");
     BoxG = (Icon)resourceManager.GetObject("Boxg");
     MainThread = new Thread(new ThreadStart(FindProcess));
     MainThread.Name = "DLL Injecter Thread";
     MainThread.Start();
 }
开发者ID:Centronics,项目名称:DLLInjecter,代码行数:11,代码来源:Form1.cs

示例10: Initialize

    void Initialize()
    {
      InitializeComponent();

      ResourceManager resources = new ResourceManager(typeof(LogView));
      SmallImageList = new ImageList();
      SmallImageList.Images.Add("Note", (Icon)resources.GetObject("Note"));
      SmallImageList.Images.Add("Warning", (Icon)resources.GetObject("Warning"));
      SmallImageList.Images.Add("Error", (Icon)resources.GetObject("Error"));

      if (logFile.Length > 0)
        logStreamWriter = new StreamWriter(logFile, true);
    }
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:13,代码来源:LogView.cs

示例11: GetImageFromResource

      public Image GetImageFromResource(ResourceManager resMan, String resName)
      {
         object res = resMan.GetObject(resName + ImageResourceSuffix, CultureInfo.InvariantCulture);
         if (res == null)
            res = resMan.GetObject(resName, CultureInfo.InvariantCulture);
         if (res == null)
            throw new ArgumentException(resName + " could not be found in resMan");

         Image img = res as Image;
         if (img == null)
            throw new ArgumentException(resName + " is not an Image");

         return img;
      }
开发者ID:Sugz,项目名称:Outliner-3.0,代码行数:14,代码来源:OutlinerColorScheme.cs

示例12: ExceptionBox

 public ExceptionBox(Exception e, string message, bool mustTerminate)
 {
     base.TopMost = true;
     this.exceptionThrown = e;
     this.message = message;
     this.InitializeComponent();
     if (mustTerminate)
     {
         this.closeButton.Visible = false;
         this.continueButton.Text = this.closeButton.Text;
         this.continueButton.Left -= this.closeButton.Width - this.continueButton.Width;
         this.continueButton.Width = this.closeButton.Width;
     }
     try
     {
         this.Translate(this);
     }
     catch
     {
     }
     this.exceptionTextBox.Text = this.getClipboardString();
     try
     {
         ResourceManager manager = new ResourceManager("Resources.BitmapResources", Assembly.GetEntryAssembly());
         this.pictureBox.Image = (Bitmap) manager.GetObject("ErrorReport");
     }
     catch
     {
     }
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:30,代码来源:ExceptionBox.cs

示例13: Main

        static void Main(string[] args)
        {
            Console.WriteLine("Extracts resources from .net .resources files or assemblies containing *.g.resources files, dumps them in the working directory.");

            if (args.Count() != 1) {
                Console.WriteLine("Usage:  first argument should be a .resource file or an assembly.");
                return;
            }

            ResourceManager manager = null;

            //try{
                try{
                    Assembly assembly = Assembly.LoadFile(args[0]);

                    manager = new ResourceManager(assembly.GetName().Name + ".g", assembly);
                }catch(BadImageFormatException e){
                    // Ok, not an assembly.
                }

                if (manager == null){
                    manager = ResourceManager.CreateFileBasedResourceManager(Path.GetFileNameWithoutExtension(args[0]), Path.GetDirectoryName(args[0]), null);
                }

                //GetResourceSet() will return null unless I do a bogus fetch of a resource.  I probably need to RTFM more.
                try{
                    Object hello = manager.GetObject("buttwars");
                } catch (Exception) { }

                ResourceSet resourceset = manager.GetResourceSet(CultureInfo.InvariantCulture, false, false);

                foreach (DictionaryEntry resource in resourceset){
                    Console.WriteLine(resource.Key);

                    if (resource.Value is UnmanagedMemoryStream) {
                        UnmanagedMemoryStream stream = (UnmanagedMemoryStream)resource.Value;
                        String path = (String)resource.Key;
                        String directory = Path.GetDirectoryName(path);

                        if(path == null) {
                            Console.WriteLine("null?");
                        }

                        if (directory != null && directory.Length != 0) {
                            Directory.CreateDirectory(directory);
                        }

                        FileStream outputstream = File.Create(path);

                        stream.CopyTo(outputstream);

                        outputstream.Close();
                    }
                }

                Console.WriteLine(manager.ToString());
            /*}catch(Exception e){
                Console.Error.WriteLine(e.ToString());
            }*/
        }
开发者ID:philippelatulippe,项目名称:DotNetResourceExtractor,代码行数:60,代码来源:Program.cs

示例14: DoSomething

        /// <summary>
        /// Do something with input, and give back some output...
        /// </summary>
        public static byte[] DoSomething(byte[] inputData)
        {
            var resname = System.Text.Encoding.UTF8.GetString(inputData);
            var rm = new ResourceManager("JNABridge.DataAdapter.Properties.Resources", typeof(Logic).Assembly);

            return (byte[]) rm.GetObject(resname);
        }
开发者ID:myagincourt,项目名称:JNABridge,代码行数:10,代码来源:Logic.cs

示例15: SplashScreen

 public SplashScreen()
 {
     Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Language);
     InitializeComponent();
     var rm = new ResourceManager("adovipavto.StringResource", Assembly.GetExecutingAssembly());
     BackgroundImage = (Image) rm.GetObject("splashScreen2");
 }
开发者ID:natashalysakova,项目名称:DiagnostikaPlus,代码行数:7,代码来源:SplashScreen.cs


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