private void addButton_Click(object sender, EventArgs e) { string str = this.addList.SelectedItem.ToString(); GameData.Desc desc = GameData.getDesc(this.Item.type, str); ItemDialog itemDialog = new ItemDialog(string.Concat("选择与 ", str, " 进行关联"), this.nav.ou.gameData, desc.list, true, "", itemType.NULL_ITEM); if (itemDialog.ShowDialog() == DialogResult.OK) { foreach (GameData.Item item in itemDialog.Items) { int?nullable = null; int?nullable1 = nullable; nullable = null; int?nullable2 = nullable; nullable = null; this.Item.addReference(str, item, nullable1, nullable2, nullable); } if (itemDialog.Items.Count > 0) { this.refresh(this.Item); this.nav.refreshState(this.Item); this.nav.HasChanges = true; if (this.ChangeEvent != null) { this.ChangeEvent(this); } } } }
private void AddItem_Click(object sender, RoutedEventArgs e) { ItemDialog itemDialog = new ItemDialog(); bool? response = itemDialog.ShowDialog(); if (response == true) { this.GetItems(); } }
private void editItem_Click(object sender, RoutedEventArgs e) { Item item = (Item)itemGrid.SelectedItem; itemGrid.UnselectAll(); ItemDialog itemDialog = new ItemDialog(item); bool? response = itemDialog.ShowDialog(); if (response == true) { this.GetItems(); } }
protected override void ButtonPressed() { PropertyGrid.PropertyGrid.Item item = this.mItem; PropertyGrid.PropertyGrid propertyGrid = this.mGrid; ItemDialog itemDialog = new ItemDialog("Referenced item", this.Source, this.TypeFilter, false, this.CustomFilter, itemType.NULL_ITEM); if (itemDialog.ShowDialog() == DialogResult.OK) { this.mItem = item; this.mGrid = propertyGrid; base.setValue(itemDialog.Items[0]); this.mItem = null; this.mGrid = null; } }
private void btnAdd_Click(object sender, EventArgs e) { var dialog = new ItemDialog(_unitOfWork, _comboView); var check = dialog.ShowDialog(); if (check.Equals(DialogResult.OK)) { MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadItemData(); this.SearchItem(); this.LoadGridItem(_selectedIndex); this.LoadModel(_model); } dialog.Dispose(); }