public CollectionCreator(String settingsFile) #endif { try { csmManager = new CsmManager(); if (String.IsNullOrEmpty(settingsFile)) { settingsFile = CCUtils.GetSettingsFilePath(); } if (File.Exists(settingsFile)) { config = CCConfiguration.FromXml(settingsFile); } if (config == null) { String errMsg = String.Format("{0}: [{1}], error code [{2}]", CCConstants.E0100, settingsFile ?? String.Empty, (int)CCEnums.CCErrorCodes.E0100); throw new Exception(errMsg); } } catch (Exception ex) { ILog.LogError(ex); throw (ex); } }
/// <summary> /// Search for files using the configuration specified as settings. /// </summary> /// <param name="profileName">The application\profile name to load from the configuration</param> /// <returns>A list of 'CCFileList' objects when successfull and the search was successfull.</returns> public static CCFileList[] SearchFiles(String profileName) { return(SearchFiles(!String.IsNullOrEmpty(profileName) ? CCConfiguration.CCConfigurationData.FromXml(CCUtils.GetSettingsFilePath(), profileName):null)); }
/// <summary> /// Get CCConfiguration from XML file, using the default path. /// </summary> /// <returns>The CCConfiguration as deserialized from XML.</returns> public static CCConfiguration FromXml() { return(FromXml(CCUtils.GetSettingsFilePath(), typeof(CCConfiguration)) as CCConfiguration); }
/// <summary> /// From XML function, deserializes a profile from XML, using the default path. /// </summary> /// <param name="profileName">the profile name to load.</param> /// <returns>CCConfigurationData</returns> public static new CCConfigurationData FromXml(String profileName) { return(FromXml(CCUtils.GetSettingsFilePath(), profileName)); }