Ejemplo n.º 1
0
        private void DataBinding()
        {
            List <AttributeMemoryInfo> attList = editor.GetAttList(weaponInfo, this.attributeList);
            List <AttributeMemoryInfo> temp    = new List <AttributeMemoryInfo>();

            foreach (AttributeMemoryInfo att in attList)
            {
                bool isAtt = false;
                foreach (AttributeMemoryInfo t in temp)
                {
                    if (t.Code == att.Code)
                    {
                        isAtt = true;
                        break;
                    }
                }
                if (!isAtt)
                {
                    temp.Add(att);
                }
            }
            cboExtendAttIndex.DataSource    = null;
            cboExtendAttIndex.DataSource    = temp;
            cboExtendAttIndex.DisplayMember = "Detail";
            lblAttCount.Text = attList.Count.ToString();
        }
Ejemplo n.º 2
0
        private void LoadItemAttributesOnClick()
        {
            ItemMemoryInfo             itemInfo    = (ItemMemoryInfo)lvMain.SelectedItems[0].Tag;
            List <AttributeMemoryInfo> itemAttList = editor.GetAttList(itemInfo, this.attributeList);

            this.selectedItem = itemInfo;

            this.txtPropName.Text     = itemInfo.ItemName;
            this.txtPropCurrDur.Text  = itemInfo.CurrentDurability.ToString();
            this.txtPropMaxDur.Text   = itemInfo.MaxDurability.ToString();
            this.txtPropAttCount.Text = itemInfo.AttCount.ToString();

            this.comboExistingAttList.DisplayMember = "Detail";
            this.comboExistingAttList.DataSource    = itemAttList;

            this.comboAddAttList.DisplayMember = "AttributeText";
            this.comboAddAttList.ValueMember   = "AttributeId";
            this.comboAddAttList.DataSource    = this.attributeList;
        }