public DashboardWindowsServiceInfo() { #region Pick Windows Dashboard Service Url ServiceUrl = GetWindowsServiceUrl(); #endregion #region Pick IISExpress or IIS Dashboard Service Url if Windows Dashboard Service is not running if (ValidateDashboardService(ServiceUrl)) { DashboardServiceSerialization serializer = new DashboardServiceSerialization(); DashboardServicePreviewSettings settings = new DashboardServicePreviewSettings(); string dashboardServiceSettingPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Syncfusion\Dashboard Platform SDK\" + Version + @"\DashboardServiceSetting.xml"; if (File.Exists(dashboardServiceSettingPath)) { settings = serializer.Deserialize(dashboardServiceSettingPath); if (!ValidateDashboardService(settings.ServiceUrl)) { ServiceUrl = settings.ServiceUrl; } else { ServiceUrl = string.Empty; Errormessage = "Syncfusion Dashboard Service is not running. Please start the SyncfusionDashboardServiceInstaller-IISExpress.exe file to start the service. Refer the online documentation link : http://help.syncfusion.com/dashboard-platform/dashboard-sdk/installation-and-deployment#hosting-dashboard-service-in-iis-express"; } } else { Errormessage = "Syncfusion Dashboard Service is not running. Please start the SyncfusionDashboardServiceInstaller-IISExpress.exe file to start the service. Refer the online documentation link : http://help.syncfusion.com/dashboard-platform/dashboard-sdk/installation-and-deployment#hosting-dashboard-service-in-iis-express"; ServiceUrl = string.Empty; } } #endregion }
public void Serialize(DashboardServicePreviewSettings settings, string path) { try { using (StreamWriter writer = new StreamWriter(path)) { previewSerializer.Serialize(writer, settings); } } catch (Exception) { } }
public DashboardServicePreviewSettings Deserialize(string path) { DashboardServicePreviewSettings settings = new DashboardServicePreviewSettings(); try { using (StreamReader reader = new StreamReader(path)) { settings = (DashboardServicePreviewSettings)previewSerializer.Deserialize(reader); } } catch (Exception) { } return(settings); }