コード例 #1
0
 /// <summary>
 /// Is raised when ThreeD mode  is activated or deactivated.
 /// </summary>
 /// <param name="CanEnable">if set to <c>true</c> [can enable].</param>
 void ThreeDEventHandler(bool CanEnable)
 {
     if (CanEnable)
     {
         if (ChartType.GetType().Name == "PieChart")
         {
             ChartType = new PieChart3D();
         }
         else if (ChartType.GetType().Name == "Doughnut")
         {
             ChartType = new Doughnut3D();
         }
         this.EnableThreeD = true;
     }
     else
     {
         if (ChartType.GetType().Name == "PieChart3D")
         {
             ChartType = new PieChart();
         }
         else if (ChartType.GetType().Name == "Doughnut3D")
         {
             ChartType = new Doughnut();
         }
         this.EnableThreeD = false;
     }
 }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="val"></param>
        /// <returns></returns>
        public static string ToDescriptionString(this ChartType val)
        {
            var attributes = val.GetType().GetField(val.ToString())?.GetCustomAttributes(typeof(DescriptionAttribute), false) as DescriptionAttribute[] ?? new DescriptionAttribute[0];

            return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
        }