コード例 #1
0
            public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
            {
                var                props   = base.GetProperties(context, value, attributes);
                psparamtype        parm    = value as psparamtype;
                List <psparameter> psprops = null;
                int                propcnt = props.Count;

                if (parm != null)
                {
                    psprops  = parm.Properties;
                    propcnt += psprops.Count;
                }
                PropertyDescriptor[] psdescs = new PropertyDescriptor[propcnt];
                props.CopyTo(psdescs, 0);

                if (psprops != null)
                {
                    int idx = props.Count;
                    foreach (psparameter psparam in psprops)
                    {
                        psdescs[idx++] = new psparamdescriptor(psparam);
                    }
                }
                return(new PropertyDescriptorCollection(psdescs));
            }
コード例 #2
0
            public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
            {
                var props = base.GetProperties(context, value, attributes);
                psparamtype parm = value as psparamtype;
                List<psparameter> psprops = null;
                int propcnt = props.Count;
                if (parm != null)
                {
                    psprops = parm.Properties;
                    propcnt += psprops.Count;
                }
                PropertyDescriptor[] psdescs = new PropertyDescriptor[propcnt];
                props.CopyTo(psdescs, 0);

                if (psprops != null)
                {
                    int idx = props.Count;
                    foreach (psparameter psparam in psprops)
                    {
                        psdescs[idx++] = new psparamdescriptor(psparam);
                    }
                }
                return new PropertyDescriptorCollection(psdescs);
            }