Форма ввода имени ресурса.
Наследование: System.Windows.Forms.Form
Пример #1
0
 private void _addResourceMenuItem_Click(object sender, EventArgs e)
 {
     using (ResourceNameForm rnf = new ResourceNameForm())
     {
         Category cc     = (Category)_categoryTree.ActiveNode;
         string   prefix = cc != null ? cc.Name + "." : "";
         rnf.ResourceName = prefix;
         if (rnf.ShowDialog(this) == DialogResult.OK)
         {
             ResourceItem ri = _rootCategory.GetItem(rnf.ResourceName);
             using (new TreeUpdateHelper(_categoryTree))
                 ri.ValueCollection[CultureInfo.InvariantCulture] = "value";
             ListViewItem lvi = CreateListItem(ri);
             using (new ListUpdateHelper(_itemList))
                 _itemList.Items.Insert(0, lvi);
             _itemList.SelectedItems.Clear();
             lvi.Selected = lvi.Focused = true;
             _propertyGrid.Focus();
         }
     }
 }
Пример #2
0
		private void _addResourceMenuItem_Click(object sender, EventArgs e)
		{
			using (ResourceNameForm rnf = new ResourceNameForm())
			{
				Category cc = (Category)_categoryTree.ActiveNode;
				string prefix = cc != null ? cc.Name + "." : "";
				rnf.ResourceName = prefix;
				if (rnf.ShowDialog(this) == DialogResult.OK)
				{
					ResourceItem ri = _rootCategory.GetItem(rnf.ResourceName);
					using (new TreeUpdateHelper(_categoryTree))
						ri.ValueCollection[CultureInfo.InvariantCulture] = "value";
					ListViewItem lvi = CreateListItem(ri);
					using (new ListUpdateHelper(_itemList))
						_itemList.Items.Insert(0, lvi);
					_itemList.SelectedItems.Clear();
					lvi.Selected = lvi.Focused = true;
					_propertyGrid.Focus();
				}
			}
		}