Пример #1
0
        private void pgDialogElement_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            TreeNode node = tvDialogDetail.SelectedNode;

            if (node.Tag.GetType() == typeof(SHDialog))
            {
                SHDialog dlg = (SHDialog)node.Tag;
                node.Text = xmlCore.GetSafeString(dlg.text);

                if (e.ChangedItem.Label == "(아이디)" && dlg.id != (int)e.OldValue)
                {
                    m_ListViewController.SortListView(dlg);
                }
            }
            else if (node.Tag.GetType() == typeof(SHDialogSay))
            {
                SHDialogSay say = (SHDialogSay)node.Tag;
                node.Text = xmlCore.GetSafeString(say.text);
            }
            else if (node.Tag.GetType() == typeof(SHDialogSelect))
            {
                SHDialogSelect sel = (SHDialogSelect)node.Tag;
                SetTreeNodeFromSel(node, sel.text, sel.exit, sel.exitSpecified);
            }
            else if (node.Tag.GetType() == typeof(SHItemAdd) || node.Tag.GetType() == typeof(SHItemRemove) || node.Tag.GetType() == typeof(SHItemFill))
            {
                SHItemAddRemoveBase itemBase = (SHItemAddRemoveBase)node.Tag;
                SetTreeNodeFromItem(node, itemBase);
            }

            Refresh_WhenPropertyValueChanged(node);
        }
Пример #2
0
        private void ProcessLootItem(ListViewItem lvi, SHLootItem item)
        {
            if (lvi == null || item == null)
            {
                return;
            }

            lvi.SubItems.Clear();

            lvi.Text = (xmlCore.Items.IsValid(item.id) && xmlCore.Items[item.id].Passed) ? xmlCore.GetSafeString(xmlCore.Items[item.id].name) : "Item does not exist (ID:" + item.id.ToString() + ")";
            lvi.SubItems.AddRange(new String[] { item.rate.ToString() + "%", (item.minSpecified) ? item.min.ToString() : "(Undefined)", (item.maxSpecified) ? item.max.ToString() : "(Undefined)" });
            lvi.Tag        = item;
            lvi.ImageIndex = 10;
            lvi.ForeColor  = (item.Passed) ? Color.Black : Color.Red;
            lvi.BackColor  = (item.Passed) ? Color.White : Color.Yellow;

            if (item.Passed && (!xmlCore.Items.IsValid(item.id) || !xmlCore.Items[item.id].Passed))
            {
                lvi.ForeColor = Color.Gray;
            }
        }