Exemplo n.º 1
0
        protected override void ProcessUpdate()
        {
            int       y     = 4;
            ArrayList valid = new ArrayList();

            lock ( controls )
            {
                controls.Clear();

                AttributeWidget aw;
                foreach (string name in ValidationManager.GetDefinedAttributeNames(parent))
                {
                    valid.Add(name);

                    switch (ValidationManager.GetAttributeType(parent, name))
                    {
                    case AttributeType.Enumerated:
                        aw = new AttributeWidgetEnum(parent, name, ValidationManager);
                        break;

                    default:
                        aw = new AttributeWidgetText(parent, name, ValidationManager);
                        break;
                    }
                    aw.Location = new Point(4, y);
                    aw.Width    = this.Width - 1;
                    aw.Height   = 22;
                    controls.Add(aw);
                    y += aw.Height;
                    Application.DoEvents();
                }

                if (parent != null)
                {
                    foreach (XmlAttribute attr in parent.Attributes)
                    {
                        if (valid.Contains(attr.Name))
                        {
                            continue;
                        }

                        aw          = new AttributeWidgetText(parent, attr.Name, ValidationManager);
                        aw.Location = new Point(4, y);
                        aw.Width    = this.Width - 1;
                        aw.Height   = 22;
                        controls.Add(aw);
                        y += aw.Height;
                        Application.DoEvents();
                    }
                }

                controls.Sort(new AttributeWidgetSorter());
            }
        }