//public GlobalAppSettings GetUserDetails(string filepath, GlobalAppSettings globalAppSettings) //{ // var usersPath = filepath + "\\userDetails.json"; // if (File.Exists(usersPath)) // { // using (StreamReader reader = new StreamReader(usersPath)) // { // string json = reader.ReadToEnd(); // var userDetail = JsonConvert.DeserializeObject<UserDetail>(json); // if (userDetail != null) // { // globalAppSettings.UserDetails = userDetail; // } // } // } // return globalAppSettings; //} public GlobalAppSettings GetUpdateSchema(GlobalAppSettings globalAppSettings, string email = null) { SamplesCollectionManager samplesCollectionManager = new SamplesCollectionManager(Startup.BasePath + "\\app_data\\default\\samples.xml", email); globalAppSettings.SamplesCollection = samplesCollectionManager.GetTreeViewModelCollection(); globalAppSettings.SamplesSchemaCollection = samplesCollectionManager.GetSchemaViewModel(); globalAppSettings.UserToken = new DashboardModel().GetToken(email); return(globalAppSettings); }
private GlobalAppSettings InitializeSystemSettings(string hostName) { var globalAppSettings = new GlobalAppSettings(); try { var filePath = Startup.BasePath + "\\app_data\\" + hostName; globalAppSettings.Identity = hostName; globalAppSettings = GetJsonData(filePath, globalAppSettings); globalAppSettings = GetEmbedDetails(filePath, globalAppSettings); //globalAppSettings = GetUserDetails(filePath, globalAppSettings); SamplesCollectionManager samplesCollectionManager = new SamplesCollectionManager(filePath + "\\samples.xml"); globalAppSettings.SamplesCollection = samplesCollectionManager.GetTreeViewModelCollection(); globalAppSettings.SamplesSchemaCollection = samplesCollectionManager.GetSchemaViewModel(); return(globalAppSettings); } catch (Exception ex) { return(null); } }