public ICommandRegion GetCommandRegion(string name) { ICommandRegion region = null; if (_CommandRegions.TryGetValue(name, out region)) { return(region); } else { return(null); } }
public void AddCommandRegion(string name, ICommandRegion region) { if (region == null) { throw new ArgumentException("Region can not be null."); } ICommandRegion existRegion = null; if (_CommandRegions.TryGetValue(name, out existRegion)) { throw new ArgumentException("Region with this name already exists."); } _CommandRegions.Add(name, region); _RegionNames.Add(name); _logger.Debug("Added command region with name " + name); }