private void AddAttribute(ItemMemoryInfo selectedItem, string attCode) { List <AttributeMemoryInfo> attList = selectedItem.ItemAttList; AttributeMemoryInfo attInfo = new AttributeMemoryInfo(); attInfo.Code = attCode; attList.Add(attInfo); selectedItem.ItemAttList = attList; LoadItemAttributesOnClick(); }
private void AddAttribute(string attCode, int count) { List <AttributeMemoryInfo> attList = weaponInfo.ItemAttList; for (int i = 0; i < count; i++) { AttributeMemoryInfo attInfo = new AttributeMemoryInfo(); attInfo.Code = attCode; attList.Add(attInfo); } weaponInfo.ItemAttList = attList; DataBinding(); isEdit = true; }
private void DeleteItemAttribute() { ItemMemoryInfo itemInfo = (ItemMemoryInfo)lvMain.SelectedItems[0].Tag; List <AttributeMemoryInfo> itemAttList = itemInfo.ItemAttList; AttributeMemoryInfo selectedAttribute = (AttributeMemoryInfo)comboExistingAttList.SelectedItem; foreach (AttributeMemoryInfo att in itemAttList) { if (att.Code.ToUpper() == selectedAttribute.Code.ToUpper()) { itemAttList.Remove(att); break; } } itemInfo.ItemAttList = itemAttList; this.txtPropAttCount.Text = itemAttList.Count.ToString(); if (itemAttList.Count <= 0) { this.txtPropSelectedAttributeHexCode.Text = ""; } LoadItemAttributesOnClick(); }
private void ComboAttList_SelectedIndexChanged(object sender, EventArgs e) { AttributeMemoryInfo itemAttribute = (AttributeMemoryInfo)comboExistingAttList.SelectedItem; this.txtPropSelectedAttributeHexCode.Text = itemAttribute.Code; }