/// <summary> /// 将 RendererType 转化为 javascript 表达式. /// </summary> /// <param name="type">插件类型.</param> /// <returns>javascript 表达式.</returns> public static string ToJavaScript(PlotPlusinType type) { if (type == PlotPlusinType.None) { return("null"); } else { return(string.Format("jQuery.jqplot.{0}", type)); } }
/// <summary> /// 将字符串转化为 RendererType. /// </summary> /// <param name="text">需要转化的字符串.</param> /// <param name="defalutType">默认类型.</param> /// <returns>插件类型.</returns> public static PlotPlusinType ToEnum(string text, PlotPlusinType defalutType) { if (string.IsNullOrEmpty(text)) { return(defalutType); } else { return(SettingHelper.ToEnum <PlotPlusinType> (text.Replace("jQuery.jqplot.", string.Empty), defalutType)); } }
/// <summary> /// 将 RendererType 转化为 javascript 表达式. /// </summary> /// <param name="type">插件类型.</param> /// <returns>javascript 表达式.</returns> public static string ToJavaScript ( PlotPlusinType type ) { if ( type == PlotPlusinType.None ) return "null"; else return string.Format ( "jQuery.jqplot.{0}", type ); }
/// <summary> /// 将字符串转化为 RendererType. /// </summary> /// <param name="text">需要转化的字符串.</param> /// <param name="defalutType">默认类型.</param> /// <returns>插件类型.</returns> public static PlotPlusinType ToEnum ( string text, PlotPlusinType defalutType ) { if ( string.IsNullOrEmpty ( text ) ) return defalutType; else return SettingHelper.ToEnum<PlotPlusinType> ( text.Replace ( "jQuery.jqplot.", string.Empty ), defalutType ); }