Ejemplo n.º 1
0
        private void AddAttribute(object sender, EventArgs e)
        {
            if (attributeText.Text.Length == 0)
            {
                MessageBox.Show(this, "Please enter the name of an attribute to create", "Add Attribute", MessageBoxButtons.OK, MessageBoxIcon.Information);
                attributeText.Focus();
                return;
            }

            if (parent.HasAttribute(attributeText.Text))
            {
                MessageBox.Show(this, "The attribute you have specified already exists", "Add Attribute", MessageBoxButtons.OK, MessageBoxIcon.Information);
                attributeText.Focus();
                return;
            }

            // TODO: H: this doesn't display (need to update controls)
            parent.SetAttribute(attributeText.Text, "");

            AttributeWidget aw = new AttributeWidgetText(parent, attributeText.Text, ValidationManager);

            aw.Location = new Point(4, 0);
            aw.Width    = this.Width - 1;
            aw.Height   = 22;
            controls.Add(aw);

            controls.Sort(new AttributeWidgetSorter());

            FilterItems(attributeText.Text);
        }
Ejemplo n.º 2
0
 private void ToggleShowValid(object sender, System.EventArgs e)
 {
     FilterItems(elementText.Text);
     elementText.Focus();
 }