本文整理汇总了C#中System.ComponentModel.ComponentResourceManager.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# ComponentResourceManager.GetString方法的具体用法?C# ComponentResourceManager.GetString怎么用?C# ComponentResourceManager.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.ComponentResourceManager
的用法示例。
在下文中一共展示了ComponentResourceManager.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reboot
public Reboot(string title, string text)
{
InitializeComponent();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Reboot));
Rectangle r = Screen.PrimaryScreen.WorkingArea;
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
//Dictionary contains reminder durations
remindTimes = new Dictionary<string, int>();
remindTimes.Add(resources.GetString("5 Minutes"), 5);
remindTimes.Add(resources.GetString("15 Minutes"), 15);
remindTimes.Add(resources.GetString("1 Hour"), 60);
remindTimes.Add(resources.GetString("4 Hours"), 240);
//Assigns dictionary as data source for combobox
remindCombo.DataSource = new BindingSource(remindTimes, null);
remindCombo.DisplayMember = "Key";
remindCombo.ValueMember = "Value";
//Sets default dropbox value
remindCombo.SelectedIndex = 0;
//Load title and text
this.rebootTitle.Text = title;
this.rebootText.Text = text;
}
示例2: TracksManagerGUI
public TracksManagerGUI(Manager database)
{
localization = new System.ComponentModel.ComponentResourceManager(typeof(WorkerTimeStrings));
this.database = database;
InitializeComponent();
this.Text = localization.GetString("String18") + " " + localization.GetString("String19");
}
示例3: TrackManagerEdit
public TrackManagerEdit(Manager database, Track track)
{
localization = new System.ComponentModel.ComponentResourceManager(typeof(WorkerTimeStrings));
this.database = database;
this.track = track;
this.Text = localization.GetString("String18") + " " + localization.GetString("String20");
InitializeComponent();
}
示例4: AboutBox
public AboutBox()
{
InitializeComponent();
System.ComponentModel.ComponentResourceManager localization = new System.ComponentModel.ComponentResourceManager(typeof(WorkerTimeStrings));
this.Text = String.Format("Sobre {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(localization.GetString("String1")) + " " + AssemblyVersion;
this.labelCopyright.Text = AssemblyCopyright;
this.textBoxInformation.Text = localization.GetString("String31");
}
示例5: ActivityBindForm
public ActivityBindForm(IServiceProvider serviceProvider, ITypeDescriptorContext context)
{
this.context = context;
this.serviceProvider = serviceProvider;
this.InitializeComponent();
this.createProperty.Checked = true;
this.helpTextBox.Multiline = true;
IUIService service = (IUIService) this.serviceProvider.GetService(typeof(IUIService));
if (service != null)
{
this.Font = (Font) service.Styles["DialogFont"];
}
ComponentResourceManager manager = new ComponentResourceManager(typeof(ActivityBindForm));
this.ActivityBindDialogTitleFormat = manager.GetString("ActivityBindDialogTitleFormat");
this.PropertyAssignableFormat = manager.GetString("PropertyAssignableFormat");
this.DescriptionFormat = manager.GetString("DescriptionFormat");
this.EditIndex = manager.GetString("EditIndex");
this.PleaseSelectCorrectActivityProperty = manager.GetString("PleaseSelectCorrectActivityProperty");
this.PleaseSelectActivityProperty = manager.GetString("PleaseSelectActivityProperty");
this.IncorrectIndexChange = manager.GetString("IncorrectIndexChange");
this.CreateNewMemberHelpFormat = manager.GetString("CreateNewMemberHelpFormat");
this.memberTypes = new ImageList();
this.memberTypes.ImageStream = (ImageListStreamer) manager.GetObject("memberTypes.ImageStream");
this.memberTypes.TransparentColor = AmbientTheme.TransparentColor;
this.properties = CustomActivityDesignerHelper.GetCustomProperties(context);
}
示例6: ActivityBindForm
public ActivityBindForm(IServiceProvider serviceProvider, ITypeDescriptorContext context)
{
this.context = context;
this.serviceProvider = serviceProvider;
InitializeComponent();
this.createProperty.Checked = true; //make the property to be the default emitted entity
this.helpTextBox.Multiline = true;
//Set dialog fonts
IUIService uisvc = (IUIService)this.serviceProvider.GetService(typeof(IUIService));
if (uisvc != null)
this.Font = (Font)uisvc.Styles["DialogFont"];
//add images to the tree-view's imagelist
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ActivityBindForm));
ActivityBindDialogTitleFormat = resources.GetString("ActivityBindDialogTitleFormat");
PropertyAssignableFormat = resources.GetString("PropertyAssignableFormat");
DescriptionFormat = resources.GetString("DescriptionFormat");
EditIndex = resources.GetString("EditIndex");
PleaseSelectCorrectActivityProperty = resources.GetString("PleaseSelectCorrectActivityProperty");
PleaseSelectActivityProperty = resources.GetString("PleaseSelectActivityProperty");
IncorrectIndexChange = resources.GetString("IncorrectIndexChange");
CreateNewMemberHelpFormat = resources.GetString("CreateNewMemberHelpFormat");
this.memberTypes = new System.Windows.Forms.ImageList();
this.memberTypes.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("memberTypes.ImageStream")));
this.memberTypes.TransparentColor = AmbientTheme.TransparentColor;
//this.memberTypes.Images.SetKeyName(0, "Field_Public");
//this.memberTypes.Images.SetKeyName(1, "Field_Internal");
//this.memberTypes.Images.SetKeyName(2, "Field_Protected");
//this.memberTypes.Images.SetKeyName(3, "Field_Private");
//this.memberTypes.Images.SetKeyName(4, "Property_Public");
//this.memberTypes.Images.SetKeyName(5, "Property_Internal");
//this.memberTypes.Images.SetKeyName(6, "Property_Protected");
//this.memberTypes.Images.SetKeyName(7, "Property_Private");
//this.memberTypes.Images.SetKeyName(8, "Constant_Public");
//this.memberTypes.Images.SetKeyName(9, "Constant_Internal");
//this.memberTypes.Images.SetKeyName(10, "Constant_Protected");
//this.memberTypes.Images.SetKeyName(11, "Constant_Private");
//this.memberTypes.Images.SetKeyName(12, "Event_Public");
//this.memberTypes.Images.SetKeyName(13, "Event_Internal");
//this.memberTypes.Images.SetKeyName(14, "Event_Protected");
//this.memberTypes.Images.SetKeyName(15, "Event_Private");
//this.memberTypes.Images.SetKeyName(16, "Delegate_Public");
//this.memberTypes.Images.SetKeyName(17, "Delegate_Internal");
//this.memberTypes.Images.SetKeyName(18, "Delegate_Protected");
//this.memberTypes.Images.SetKeyName(19, "Delegate_Private");
//this.memberTypes.Images.SetKeyName(20, "Index_Public");
//this.memberTypes.Images.SetKeyName(21, "Index_Internal");
//this.memberTypes.Images.SetKeyName(22, "Index_Protected");
//this.memberTypes.Images.SetKeyName(23, "Index_Private");
//preload custom properties before getting type from the type provider (as it would refresh the types)
this.properties = CustomActivityDesignerHelper.GetCustomProperties(context);
}
示例7: InitializeComponent
private void InitializeComponent()
{
this.components = (IContainer)new Container();
ComponentResourceManager resources = new ComponentResourceManager(typeof(about));
this.pictureBox1 = new PictureBox();
this.richTextBox1 = new RichTextBox();
this.richTextBox2 = new RichTextBox();
((ISupportInitialize)this.pictureBox1).BeginInit();
this.SuspendLayout();
this.pictureBox1.Image = (Image)resources.GetObject("pictureBox1.Image");
this.pictureBox1.Location = new Point(14, 16);
this.pictureBox1.Margin = new Padding(3, 4, 3, 4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new Size(128, 128);
this.pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.richTextBox1.Font = new Font("Arial Unicode MS", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte)134);
this.richTextBox1.Location = new Point(148, 13);
this.richTextBox1.Margin = new Padding(3, 4, 3, 4);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new Size(333, 131);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = resources.GetString("richTextBox1.Text");
this.richTextBox2.Location = new Point(14, 151);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.ReadOnly = true;
this.richTextBox2.ScrollBars = RichTextBoxScrollBars.None;
this.richTextBox2.Size = new Size(467, 249);
this.richTextBox2.TabIndex = 2;
this.richTextBox2.Text = resources.GetString("richTextBox2.Text");
this.AutoScaleDimensions = new SizeF(7f, 16f);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(496, 412);
this.Controls.Add((Control)this.richTextBox2);
this.Controls.Add((Control)this.richTextBox1);
this.Controls.Add((Control)this.pictureBox1);
this.Font = new Font("Arial Unicode MS", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte)0);
this.Icon = (Icon)resources.GetObject("$this.Icon");
this.Margin = new Padding(3, 4, 3, 4);
this.MaximizeBox = false;
this.Name = "about";
this.Text = "About HopeRF";
((ISupportInitialize)this.pictureBox1).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
示例8: InitializeComponent
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(formAbout));
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.richTextBox1.Location = new System.Drawing.Point(14, 19);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(403, 328);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = resources.GetString("richTextBox1.Text");
//
// formAbout
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(430, 366);
this.Controls.Add(this.richTextBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "formAbout";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "开发人员";
this.ResumeLayout(false);
}
示例9: InitializeComponent
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Labelled));
this.groupBox1 = new GroupBox();
this.textBox1 = new TextBox();
this.groupBox1.SuspendLayout();
base.SuspendLayout();
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Location = new Point(13, 10);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new Size(0x128, 0x189);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "标签说明:";
this.textBox1.Location = new Point(7, 0x15);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new Size(0x11b, 0x162);
this.textBox1.TabIndex = 0;
this.textBox1.Text = resources.GetString("textBox1.Text");
base.AutoScaleDimensions = new SizeF(6f, 12f);
base.AutoScaleMode = AutoScaleMode.Font;
base.ClientSize = new Size(0x141, 0x199);
base.Controls.Add(this.groupBox1);
base.FormBorderStyle = FormBorderStyle.FixedDialog;
base.MaximizeBox = false;
base.MinimizeBox = false;
base.Name = "Labelled";
base.StartPosition = FormStartPosition.CenterScreen;
this.Text = "Labelled";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
base.ResumeLayout(false);
}
示例10: AppLang
/// <summary>
/// 遍历窗体所有控件,针对其设置当前界面语言
/// </summary>
/// <param name="contrl"></param>
/// <param name="resoureces"></param>
private static void AppLang(Control control, ComponentResourceManager resources, ToolTip tp = null)
{
if (control is MenuStrip)
{
//将资源应用与对应的属性
resources.ApplyResources(control, control.Name);
MenuStrip ms = (MenuStrip)control;
if (ms.Items.Count > 0)
{
foreach (ToolStripMenuItem c in ms.Items)
{
//调用 遍历菜单 设置语言
AppLang(c, resources);
}
}
}
foreach (Control c in control.Controls)
{
resources.ApplyResources(c, c.Name);
if (tp != null)
{
//MessageBox.Show(c.Name);
tp.SetToolTip(c, resources.GetString(c.Name + ".ToolTip"));
}
AppLang(c, resources);
}
}
示例11: btnAddSave_Click
private void btnAddSave_Click(object sender, EventArgs e)
{
int saveSelectedIndex = listBox.SelectedIndex;
System.ComponentModel.ComponentResourceManager localResources = new System.ComponentModel.ComponentResourceManager(typeof(CustomEventsForm));
if (txtCmd.Text == "")
{
MessageBox.Show(localResources.GetString("enterCommand"));
return;
}
int selectedIndex = listBox.SelectedIndex;
if (listBox.SelectedIndex == -1)
{
CustomEvent customEvent = new CustomEvent(
txtCmd.Text, txtArgs.Text, boxWait.Checked);
curCustomEvents.Add(customEvent);
}
else
{
CustomEvent customEvent = curCustomEvents[listBox.SelectedIndex];
customEvent.cmd = txtCmd.Text;
customEvent.args = txtArgs.Text;
customEvent.execWait = boxWait.Checked;
}
RefreshDisplay();
listBox.SelectedIndex = -1; // Force refresh
listBox.SelectedIndex = saveSelectedIndex; // Re-select edited item
ActiveControl = comboBox;
}
示例12: button2_Click
private void button2_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Do you want to reset the language window?", "Reset", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
textBox1.Text = resources.GetString("textBox1.Text");
}
}
示例13: GenericManagerGUI
public GenericManagerGUI(Manager database, String title, String table, String fields)
{
localization = new System.ComponentModel.ComponentResourceManager(typeof(WorkerTimeStrings));
this.database = database;
this.table = table;
this.fields = fields;
InitializeComponent();
this.Text = localization.GetString("String18") + " " + title.ToLower();
}
示例14: ConfigurationForm
public ConfigurationForm()
{
resources = new ComponentResourceManager(typeof(ConfigurationForm));
InitializeComponent();
this.Text = resources.GetString("configuration");
this.CenterToParent();
ConfigXML configXML = new ConfigXML();
textBoxHost.Text = configXML.getHost();
textBoxUserName.Text = configXML.getUser();
textBoxPassword.Text = configXML.getPassword();
}
示例15: TextPreview
public TextPreview(Font font, CultureInfo locale)
: this()
{
Thread.CurrentThread.CurrentUICulture = locale;
ComponentResourceManager resources = new ComponentResourceManager(this.GetType());
Localizer.ApplyResourceToControl(resources, this, locale);
Text = resources.GetString("$this.Text", locale);
this.font = font;
tText.Font = this.font;
}