Example #1
0
        private void ItemsAfterSelect(object sender, TreeViewEventArgs e)
        {
            // Disable OK button until we have a valid image.
            btnOK.Enabled            = false;
            SelectedAtributeName     = null;
            pgPreview.SelectedObject = null;

            // Do we have something new?
            if (e.Node == null)
            {
                return;
            }

            // See if the "none" entry is selected.
            if (e.Node.Name.Equals(""))
            {
                btnOK.Enabled = true;
                return;
            }

            // See if the item is valid.
            var itemPool = AttributePoolManager.GetAttributePool(e.Node.Name);

            if (itemPool == null)
            {
                return;
            }

            // OK, allow selecting it.
            btnOK.Enabled            = true;
            SelectedAtributeName     = e.Node.Name;
            pgPreview.SelectedObject = itemPool;
        }
Example #2
0
 private void NameChanged(object sender, EventArgs e)
 {
     btnOK.Enabled = !string.IsNullOrWhiteSpace(tbName.Text) && AttributePoolManager.GetAttributePool(tbName.Text.Trim()) == null;
 }