public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            ArrayList props = new ArrayList();

            foreach (XmlNode columnNode in rowElement.ParentNode.SelectNodes("wix:Column", WixFiles.WxsNsmgr))
            {
                ArrayList attrs = new ArrayList();

                // Add default attributes Category, TypeConverter and Description
                attrs.Add(new CategoryAttribute("WXS Attribute"));

                // Make Attribute array
                Attribute[] attrArray = (Attribute[])attrs.ToArray(typeof(Attribute));

                XmlAttribute typeAttrib = columnNode.Attributes["Type"];
                if (typeAttrib != null)
                {
                    if (typeAttrib.Value == "string")
                    {
                        attrs.Add(new TypeConverterAttribute(typeof(StringConverter)));
                    }
                    else if (typeAttrib.Value == "int" || typeAttrib.Value == "integer")
                    {
                        attrs.Add(new TypeConverterAttribute(typeof(IntegerConverter)));
                    }
                    else if (typeAttrib.Value == "binary")
                    {
                        attrs.Add(new TypeConverterAttribute(typeof(StringConverter)));
                    }
                }

                // Create and add PropertyDescriptor
                CustomTableRowElementPropertyDescriptor pd = new CustomTableRowElementPropertyDescriptor(rowElement, WixFiles,
                                                                                                         columnNode.Attributes["Id"].Value, attrArray);

                props.Add(pd);
            }

            PropertyDescriptor[] propArray = props.ToArray(typeof(PropertyDescriptor)) as PropertyDescriptor[];

            return(new PropertyDescriptorCollection(propArray));
        }
Ejemplo n.º 2
0
        public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            ArrayList props = new ArrayList();

            foreach (XmlNode columnNode in rowElement.ParentNode.SelectNodes("wix:Column", WixFiles.WxsNsmgr))
            {
                ArrayList attrs = new ArrayList();

                // Add default attributes Category, TypeConverter and Description
                attrs.Add(new CategoryAttribute("WXS Attribute"));

                // Make Attribute array
                Attribute[] attrArray = (Attribute[])attrs.ToArray(typeof(Attribute));

                XmlAttribute typeAttrib = columnNode.Attributes["Type"];
                if (typeAttrib != null)
                {
                    if (typeAttrib.Value == "string")
                    {
                        attrs.Add(new TypeConverterAttribute(typeof(StringConverter)));
                    }
                    else if (typeAttrib.Value == "int" || typeAttrib.Value == "integer")
                    {
                        attrs.Add(new TypeConverterAttribute(typeof(IntegerConverter)));
                    }
                    else if (typeAttrib.Value == "binary")
                    {
                        attrs.Add(new TypeConverterAttribute(typeof(StringConverter)));
                    }
                }

                // Create and add PropertyDescriptor
                CustomTableRowElementPropertyDescriptor pd = new CustomTableRowElementPropertyDescriptor(rowElement, WixFiles,
                    columnNode.Attributes["Id"].Value, attrArray);

                props.Add(pd);
            }

            PropertyDescriptor[] propArray = props.ToArray(typeof(PropertyDescriptor)) as PropertyDescriptor[];

            return new PropertyDescriptorCollection(propArray);
        }