Example #1
0
        // TODO: pass in image list rather than rely on static
        public AttributeWidget(XmlElement element, string attrName, IValidationProvider val)
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();
            InitImageList();

            this.element   = element;
            this.attrName  = attrName;
            this.validator = val;

            label          = new Label();
            label.Location = new Point(0, 2);
            label.Text     = attrName;
            label.Width    = 80;

            fixedAttribute    = val.IsAttributeFixed(element, attrName);
            requiredAttribute = val.IsAttributeRequired(element, attrName);

            FlatButton b = new FlatButton();

            b.Location          = new Point(label.Width, 2);
            b.ImageList         = globalImageList;
            b.ImageIndex        = 0;
            b.Size              = new System.Drawing.Size(16, 16);
            b.FlatStyle         = FlatStyle.Popup;
            deleteButton        = b;
            deleteButton.Click += new EventHandler(DeleteAttribute);

            UpdateState();

            Controls.Add(label);
//			Controls.Add(toolBar1);
            Controls.Add(deleteButton);
        }