public ReflectGroup GetValue(string groupName) { #region Contracts if (string.IsNullOrEmpty(groupName) == true) { throw new ArgumentNullException(); } #endregion lock (_syncRoot) { // Cache if (_cacheGroupName == groupName) { return(_cacheGroupInstance); } _cacheGroupName = groupName; _cacheGroupInstance = _repository.GetValue(groupName); // Return return(_cacheGroupInstance); } }
// Methods public void Add(string groupName) { #region Contracts if (string.IsNullOrEmpty(groupName) == true) throw new ArgumentNullException(); #endregion lock (_syncRoot) { // Cache _cacheGroupName = null; _cacheGroupInstance = null; // Repository _repository.Add(groupName); } }
public void Remove(string groupName) { #region Contracts if (string.IsNullOrEmpty(groupName) == true) { throw new ArgumentNullException(); } #endregion lock (_syncRoot) { // Cache _cacheGroupName = null; _cacheGroupInstance = null; // Repository _repository.Remove(groupName); } }
public ReflectGroup GetValue(string groupName) { #region Contracts if (string.IsNullOrEmpty(groupName) == true) throw new ArgumentNullException(); #endregion lock (_syncRoot) { // Cache if (_cacheGroupName == groupName) return _cacheGroupInstance; _cacheGroupName = groupName; _cacheGroupInstance = _repository.GetValue(groupName); // Return return _cacheGroupInstance; } }