Пример #1
0
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            string typeList = (string)value;

            if (context == null)
            {
                return(base.ConvertFrom(context, culture, value));
            }
            string[] strArray  = StringHelpers.SplitTypeList(typeList);
            Type[]   typeArray = new Type[strArray.Length];
            for (int i = 0; i < strArray.Length; i++)
            {
                typeArray[i] = (Type)typeTypeConverter.ConvertFrom(context, TypeConverterHelper.InvariantEnglishUS, strArray[i]);
            }
            return(typeArray);
        }
Пример #2
0
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            string typeList = (string)value;

            if (null != context)
            {
                // Consider HashMap(int, int), HashMap(int, int)
                string[] tl    = StringHelpers.SplitTypeList(typeList);
                Type[]   types = new Type[tl.Length];
                for (int i = 0; i < tl.Length; i++)
                {
                    types[i] = (Type)typeTypeConverter.ConvertFrom(context, TypeConverterHelper.InvariantEnglishUS, tl[i]);
                }
                return(types);
            }
            return(base.ConvertFrom(context, culture, value));
        }