ComponentResourceManager ComponentResourceManager ComponentResourceManager ComponentResourceManager Class

정의

구성 요소나 개체의 리소스를 열거하는 간단한 기능을 제공합니다.Provides simple functionality for enumerating resources for a component or object. ComponentResourceManager 클래스는 ResourceManager입니다.The ComponentResourceManager class is a ResourceManager.

public ref class ComponentResourceManager : System::Resources::ResourceManager
public class ComponentResourceManager : System.Resources.ResourceManager
type ComponentResourceManager = class
    inherit ResourceManager
Public Class ComponentResourceManager
Inherits ResourceManager
상속
ComponentResourceManagerComponentResourceManagerComponentResourceManagerComponentResourceManager

예제

다음 코드 예제에 사용 하는 방법을 보여 줍니다 ComponentResourceManager 이미지 리소스를 할당 하는 Image 의 속성 ToolStripButton 컨트롤입니다.The following code example demonstrates how to use ComponentResourceManager to assign image resources to the Image property of ToolStripButton controls.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication10
{
    public class Form1 : Form
    {
        private ToolStripButton toolStripButton1;
        private ToolStripButton toolStripButton2;
        private ToolStripButton toolStripButton3;
        private ContextMenuStrip contextMenuStrip1;
        private IContainer components;
        private ToolStripMenuItem toolStripMenuItem1;
        private ToolStripMenuItem toolStripMenuItem2;
        private ContextMenuStrip contextMenuStrip2;
        private ToolStripMenuItem rearrangeButtonsToolStripMenuItem;
        private ToolStripMenuItem selectIconsToolStripMenuItem;
        private ToolStrip toolStrip1;
    
        public Form1()
        {
            InitializeComponent();
        }
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new Form1());
        }

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
            this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
            this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
            this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
            this.rearrangeButtonsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.selectIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStrip1.SuspendLayout();
            this.contextMenuStrip1.SuspendLayout();
            this.contextMenuStrip2.SuspendLayout();
            this.SuspendLayout();
            //
            // Associate contextMenuStrip2 with toolStrip1.
            // toolStrip1 property settings follow.
            //
            this.toolStrip1.ContextMenuStrip = this.contextMenuStrip2;
            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripButton1,
            this.toolStripButton2,
            this.toolStripButton3});
            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
            this.toolStrip1.Name = "toolStrip1";
            this.toolStrip1.Size = new System.Drawing.Size(292, 25);
            this.toolStrip1.TabIndex = 0;
            this.toolStrip1.Text = "toolStrip1";
            // 
            // toolStripButton1
            // 
            this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
            this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton1.Name = "toolStripButton1";
            this.toolStripButton1.Text = "toolStripButton1";
            // 
            // toolStripButton2
            // 
            this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
            this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton2.Name = "toolStripButton2";
            this.toolStripButton2.Text = "toolStripButton2";
            // 
            // toolStripButton3
            // 
            this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
            this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton3.Name = "toolStripButton3";
            this.toolStripButton3.Text = "toolStripButton3";
            // 
            // contextMenuStrip1
            // 
            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripMenuItem1,
            this.toolStripMenuItem2});
            this.contextMenuStrip1.Name = "contextMenuStrip1";
            this.contextMenuStrip1.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.contextMenuStrip1.Size = new System.Drawing.Size(131, 48);
            // 
            // contextMenuStrip2
            // 
            this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.rearrangeButtonsToolStripMenuItem,
            this.selectIconsToolStripMenuItem});
            this.contextMenuStrip2.Name = "contextMenuStrip2";
            this.contextMenuStrip2.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.contextMenuStrip2.Size = new System.Drawing.Size(162, 48);
            // 
            // toolStripMenuItem1
            // 
            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
            this.toolStripMenuItem1.Text = "&Resize";
            // 
            // toolStripMenuItem2
            // 
            this.toolStripMenuItem2.Name = "toolStripMenuItem2";
            this.toolStripMenuItem2.Text = "&Keep on Top";
            // 
            // rearrangeButtonsToolStripMenuItem
            // 
            this.rearrangeButtonsToolStripMenuItem.Name = "rearrangeButtonsToolStripMenuItem";
            this.rearrangeButtonsToolStripMenuItem.Text = "R&earrange Buttons";
            // 
            // selectIconsToolStripMenuItem
            // 
            this.selectIconsToolStripMenuItem.Name = "selectIconsToolStripMenuItem";
            this.selectIconsToolStripMenuItem.Text = "&Select Icons";
            // 
            // Associate contextMenuStrip1 with Form1.
            // Form1 property settings follow.
            //
            this.ClientSize = new System.Drawing.Size(292, 266);
            this.ContextMenuStrip = this.contextMenuStrip1;
            this.Controls.Add(this.toolStrip1);
            this.Name = "Form1";
            this.toolStrip1.ResumeLayout(false);
            this.contextMenuStrip1.ResumeLayout(false);
            this.contextMenuStrip2.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }
    }
}
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms

Public Class Form1
   Inherits Form
   Private toolStripButton1 As ToolStripButton
   Private toolStripButton2 As ToolStripButton
   Private toolStripButton3 As ToolStripButton
   Private contextMenuStrip1 As ContextMenuStrip
   Private components As IContainer
   Private toolStripMenuItem1 As ToolStripMenuItem
   Private toolStripMenuItem2 As ToolStripMenuItem
   Private contextMenuStrip2 As ContextMenuStrip
   Private rearrangeButtonsToolStripMenuItem As ToolStripMenuItem
   Private selectIconsToolStripMenuItem As ToolStripMenuItem
   Private toolStrip1 As ToolStrip
   
   
   Public Sub New()
        InitializeComponent()
    End Sub

    <STAThread()> _
    Public Sub Main()
        Application.EnableVisualStyles()
        Application.Run(New Form1())
    End Sub

    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(Form1))
        Me.toolStrip1 = New System.Windows.Forms.ToolStrip()
        Me.toolStripButton1 = New System.Windows.Forms.ToolStripButton()
        Me.toolStripButton2 = New System.Windows.Forms.ToolStripButton()
        Me.toolStripButton3 = New System.Windows.Forms.ToolStripButton()
        Me.contextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
        Me.contextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
        Me.toolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
        Me.toolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
        Me.rearrangeButtonsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.selectIconsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
        Me.toolStrip1.SuspendLayout()
        Me.contextMenuStrip1.SuspendLayout()
        Me.contextMenuStrip2.SuspendLayout()
        Me.SuspendLayout()
        '
        ' Associate contextMenuStrip2 with toolStrip1.
        ' toolStrip1 property settings follow.
        '
        Me.toolStrip1.ContextMenuStrip = Me.contextMenuStrip2
        Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripButton1, Me.toolStripButton2, Me.toolStripButton3})
        Me.toolStrip1.Location = New System.Drawing.Point(0, 0)
        Me.toolStrip1.Name = "toolStrip1"
        Me.toolStrip1.Size = New System.Drawing.Size(292, 25)
        Me.toolStrip1.TabIndex = 0
        Me.toolStrip1.Text = "toolStrip1"
        ' 
        ' toolStripButton1
        ' 
        Me.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
        Me.toolStripButton1.Image = CType(resources.GetObject("toolStripButton1.Image"), System.Drawing.Image)
        Me.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta
        Me.toolStripButton1.Name = "toolStripButton1"
        Me.toolStripButton1.Text = "toolStripButton1"
        ' 
        ' toolStripButton2
        ' 
        Me.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
        Me.toolStripButton2.Image = CType(resources.GetObject("toolStripButton2.Image"), System.Drawing.Image)
        Me.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta
        Me.toolStripButton2.Name = "toolStripButton2"
        Me.toolStripButton2.Text = "toolStripButton2"
        ' 
        ' toolStripButton3
        ' 
        Me.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
        Me.toolStripButton3.Image = CType(resources.GetObject("toolStripButton3.Image"), System.Drawing.Image)
        Me.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta
        Me.toolStripButton3.Name = "toolStripButton3"
        Me.toolStripButton3.Text = "toolStripButton3"
        ' 
        ' contextMenuStrip1
        ' 
        Me.contextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItem1, Me.toolStripMenuItem2})
        Me.contextMenuStrip1.Name = "contextMenuStrip1"
        Me.contextMenuStrip1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.contextMenuStrip1.Size = New System.Drawing.Size(131, 48)
        ' 
        ' contextMenuStrip2
        ' 
        Me.contextMenuStrip2.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.rearrangeButtonsToolStripMenuItem, Me.selectIconsToolStripMenuItem})
        Me.contextMenuStrip2.Name = "contextMenuStrip2"
        Me.contextMenuStrip2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.contextMenuStrip2.Size = New System.Drawing.Size(162, 48)
        ' 
        ' toolStripMenuItem1
        ' 
        Me.toolStripMenuItem1.Name = "toolStripMenuItem1"
        Me.toolStripMenuItem1.Text = "&Resize"
        ' 
        ' toolStripMenuItem2
        ' 
        Me.toolStripMenuItem2.Name = "toolStripMenuItem2"
        Me.toolStripMenuItem2.Text = "&Keep on Top"
        ' 
        ' rearrangeButtonsToolStripMenuItem
        ' 
        Me.rearrangeButtonsToolStripMenuItem.Name = "rearrangeButtonsToolStripMenuItem"
        Me.rearrangeButtonsToolStripMenuItem.Text = "R&earrange Buttons"
        ' 
        ' selectIconsToolStripMenuItem
        ' 
        Me.selectIconsToolStripMenuItem.Name = "selectIconsToolStripMenuItem"
        Me.selectIconsToolStripMenuItem.Text = "&Select Icons"
        ' 
        ' Associate contextMenuStrip1 with Form1.
        ' Form1 property settings follow.
        '
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.ContextMenuStrip = Me.contextMenuStrip1
        Me.Controls.Add(toolStrip1)
        Me.Name = "Form1"
        Me.toolStrip1.ResumeLayout(False)
        Me.contextMenuStrip1.ResumeLayout(False)
        Me.contextMenuStrip2.ResumeLayout(False)
        Me.ResumeLayout(False)
        Me.PerformLayout()
    End Sub

생성자

ComponentResourceManager() ComponentResourceManager() ComponentResourceManager() ComponentResourceManager()

기본값을 사용하여 ComponentResourceManager 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ComponentResourceManager class with default values.

ComponentResourceManager(Type) ComponentResourceManager(Type) ComponentResourceManager(Type) ComponentResourceManager(Type)

지정된 ComponentResourceManager의 정보를 기초로 위성 어셈블리에서 리소스를 찾는 Type를 만듭니다.Creates a ComponentResourceManager that looks up resources in satellite assemblies based on information from the specified Type.

메서드

ApplyResources(Object, String) ApplyResources(Object, String) ApplyResources(Object, String) ApplyResources(Object, String)

리소스의 값을 개체의 해당 속성에 적용합니다.Applies a resource's value to the corresponding property of the object.

ApplyResources(Object, String, CultureInfo) ApplyResources(Object, String, CultureInfo) ApplyResources(Object, String, CultureInfo) ApplyResources(Object, String, CultureInfo)

리소스의 값을 개체의 해당 속성에 적용합니다.Applies a resource's value to the corresponding property of the object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetObject(String) GetObject(String) GetObject(String) GetObject(String)

지정된 문자열이 아닌 리소스의 값을 반환합니다.Returns the value of the specified non-string resource.

(Inherited from ResourceManager)
GetObject(String, CultureInfo) GetObject(String, CultureInfo) GetObject(String, CultureInfo) GetObject(String, CultureInfo)

지정된 문화권에 대해 지역화된 비문자열 리소스의 값을 가져옵니다.Gets the value of the specified non-string resource localized for the specified culture.

(Inherited from ResourceManager)
GetResourceFileName(CultureInfo) GetResourceFileName(CultureInfo) GetResourceFileName(CultureInfo) GetResourceFileName(CultureInfo)

지정된 CultureInfo 개체에 대한 리소스 파일 이름을 생성합니다.Generates the name of the resource file for the given CultureInfo object.

(Inherited from ResourceManager)
GetResourceSet(CultureInfo, Boolean, Boolean) GetResourceSet(CultureInfo, Boolean, Boolean) GetResourceSet(CultureInfo, Boolean, Boolean) GetResourceSet(CultureInfo, Boolean, Boolean)

특정 문화에 대해 설정된 리소스를 검색합니다.Retrieves the resource set for a particular culture.

(Inherited from ResourceManager)
GetStream(String) GetStream(String) GetStream(String) GetStream(String)

관리되지 않는 메모리 스트림 개체에서 지정된 리소스를 반환합니다.Returns an unmanaged memory stream object from the specified resource.

(Inherited from ResourceManager)
GetStream(String, CultureInfo) GetStream(String, CultureInfo) GetStream(String, CultureInfo) GetStream(String, CultureInfo)

지정된 문화권을 사용하여 지정된 리소스에서 관리되지 않은 메모리 스트림 개체를 반환합니다.Returns an unmanaged memory stream object from the specified resource, using the specified culture.

(Inherited from ResourceManager)
GetString(String) GetString(String) GetString(String) GetString(String)

지정된 문자열 리소스의 값을 반환합니다.Returns the value of the specified string resource.

(Inherited from ResourceManager)
GetString(String, CultureInfo) GetString(String, CultureInfo) GetString(String, CultureInfo) GetString(String, CultureInfo)

지정된 문화권에 대해 지역화된 문자열 리소스의 값을 반환합니다.Returns the value of the string resource localized for the specified culture.

(Inherited from ResourceManager)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
InternalGetResourceSet(CultureInfo, Boolean, Boolean) InternalGetResourceSet(CultureInfo, Boolean, Boolean) InternalGetResourceSet(CultureInfo, Boolean, Boolean) InternalGetResourceSet(CultureInfo, Boolean, Boolean)

리소스 집합을 찾는 구현을 제공합니다.Provides the implementation for finding a resource set.

(Inherited from ResourceManager)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
ReleaseAllResources() ReleaseAllResources() ReleaseAllResources() ReleaseAllResources()

리소스 담당자에게 모든 Close() 개체에 있는 ResourceSet 메서드를 호출하고 모든 리소스를 해제하도록 알립니다.Tells the resource manager to call the Close() method on all ResourceSet objects and release all resources.

(Inherited from ResourceManager)
ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

속성

BaseName BaseName BaseName BaseName

ResourceManager에서 리소스를 검색하는 리소스 파일의 루트 이름을 가져옵니다.Gets the root name of the resource files that the ResourceManager searches for resources.

(Inherited from ResourceManager)
FallbackLocation FallbackLocation FallbackLocation FallbackLocation

기본 대체(fallback) 리소스를 검색할 위치를 가져오거나 설정합니다.Gets or sets the location from which to retrieve default fallback resources.

(Inherited from ResourceManager)
IgnoreCase IgnoreCase IgnoreCase IgnoreCase

리소스 관리자가 GetString(String)GetObject(String) 메서드에서 대/소문자를 구분하지 않고 리소스를 조회할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value that indicates whether the resource manager allows case-insensitive resource lookups in the GetString(String) and GetObject(String) methods.

(Inherited from ResourceManager)
ResourceSetType ResourceSetType ResourceSetType ResourceSetType

리소스 관리자가 ResourceSet 개체를 생성하는 데 사용하는 리소스 집합 개체의 형식을 가져옵니다.Gets the type of the resource set object that the resource manager uses to construct a ResourceSet object.

(Inherited from ResourceManager)

필드

BaseNameField BaseNameField BaseNameField BaseNameField

ResourceManager에서 리소스를 검색하는 리소스 파일의 루트 이름을 지정합니다.Specifies the root name of the resource files that the ResourceManager searches for resources.

(Inherited from ResourceManager)
MainAssembly MainAssembly MainAssembly MainAssembly

리소스를 포함한 주 어셈블리를 지정합니다.Specifies the main assembly that contains the resources.

(Inherited from ResourceManager)
ResourceSets ResourceSets ResourceSets ResourceSets

문화권에서 Hashtable 개체로의 매핑을 반환하는 ResourceSet이 들어 있습니다.Contains a Hashtable that returns a mapping from cultures to ResourceSet objects.

(Inherited from ResourceManager)

적용 대상