예제 #1
0
            /// <summary>
            /// Method used to do the conversion.
            /// </summary>
            public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destType)
            {
                // check if InstanceDescriptor (used by IDE to serialize the values)
                if (destType == typeof(InstanceDescriptor))
                {
                    ChartSeriesValue seriesValue = (ChartSeriesValue)value;
                    // use the default constructor
                    return(new InstanceDescriptor(typeof(ChartSeriesValue).GetConstructor(new Type[] { typeof(DateTime), typeof(Decimal) }),
                                                  new object[] { seriesValue.Date, seriesValue.Value },
                                                  false));
                }

                // call base class for other types
                return(base.ConvertTo(context, culture, value, destType));
            }
예제 #2
0
 /// <summary>
 /// Removes the first occurrence of a specific ChartSeriesValue from the ChartSeriesValueCollection.
 /// </summary>
 /// <param name="seriesValue">The ChartSeriesValue object to be removed from the ChartSeriesValueCollection. The value can be null.</param>
 public void Remove(ChartSeriesValue seriesValue)
 {
     base.InnerList.Remove(seriesValue);
 }
예제 #3
0
 /// <summary>
 /// Adds an ChartSeriesValue to the end of the ChartSeriesValueCollection.
 /// </summary>
 /// <param name="seriesValue">The ChartSeriesValue to be added to the end of the ChartSeriesValueCollection. The value can be null.</param>
 public void Add(ChartSeriesValue seriesValue)
 {
     base.InnerList.Add(seriesValue);
     this.isEmpty = false;
 }