/// <summary> /// Populates the object from specified configuration string. /// </summary> /// <returns></returns> internal static CacheConfig FromPropertyString(string props) { CacheConfig cConfig = null; if (props != null) { PropsConfigReader pcr = new PropsConfigReader(props); IDictionary cacheConfig = pcr.Properties; cConfig = CacheConfig.FromProperties(cacheConfig); } return(cConfig); }
/// <summary> /// Initialize a registered cache given by the ID. /// </summary> /// <param name="cacheId">A string identifier of configuration.</param> static public CacheConfig GetCacheConfig(string cacheId) { if (FileName.Length == 0) { throw new ManagementException("Can not locate cache configuration file. Installation might be corrupt"); } try { XmlConfigReader configReader = new XmlConfigReader(FileName, cacheId); return(CacheConfig.FromProperties(configReader.Properties)); } catch (ManagementException) { throw; } catch (Exception e) { throw new ManagementException(e.Message, e); } }