16 public static class DashboardFactory
18 private static IDashboard _dashboard;
24 public static IDashboard GetDashboard()
26 IDashboard result =
null;
27 if (_dashboard ==
null)
29 var typeName = ConfigurationManager.AppSettings[
"CslaDashboardType"];
30 if (!
string.IsNullOrWhiteSpace(typeName))
32 if (typeName ==
"Dashboard")
33 result =
new Dashboard();
34 else if (typeName ==
"NullDashboard")
35 result =
new NullDashboard();
37 result = (IDashboard)Reflection.MethodCaller.CreateInstance(Type.GetType(typeName));
41 result =
new NullDashboard();
55 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
56 public static void Reset()
58 _dashboard?.Dispose();
60 DataPortal.Dashboard = GetDashboard();