コード例 #1
0
        //public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
        //{
        //    if (destinationType == typeof(string))
        //    {
        //        return true;
        //    }
        //    return base.CanConvertTo(context, destinationType);
        //}

        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == typeof(string))
            {
                if (context.Instance is RadarAlertSeries)
                {
                    RadarAlertSeries control = null;
                    control = context.Instance as RadarAlertSeries;
                    return(control.RadarAlertProperties.CustomProperties);
                }
            }
            return(base.ConvertTo(context, culture, value, destinationType));
        }
コード例 #2
0
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            RadarAlertSeries control = new RadarAlertSeries(null);

            if (context.Instance is RadarAlertSeries)
            {
                control = context.Instance as RadarAlertSeries;
            }

            string[] strArray = new string[control.legendList.Count];
            for (int i = 0; i < strArray.Length; i++)
            {
                strArray[i] = control.legendList[i].Name;
            }
            StandardValuesCollection returnStandardValuesCollection = new StandardValuesCollection(strArray);

            return(returnStandardValuesCollection);
        }