Ejemplo n.º 1
0
        /// <inheritdoc />
        public void ActivateAllElements(string region)
        {
            if (region == null)
            {
                throw new ArgumentNullException(nameof(region));
            }

            if (string.IsNullOrWhiteSpace(region))
            {
                throw new ArgumentException("Parameter is an empty string.", nameof(region));
            }

            if (!this.RegionDictionary.ContainsKey(region))
            {
                throw new RegionNotFoundException(region);
            }

            object container = this.RegionDictionary[region]
                               .Item1;

            IRegionAdapter adapter = this.RegionDictionary[region]
                                     .Item2;

            List <object> elements = adapter.Get(container);

            foreach (object element in elements)
            {
                adapter.Activate(container, element);
            }

            adapter.Sort(container);
        }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public List <object> GetElementsOfRegion(string region)
        {
            if (region == null)
            {
                throw new ArgumentNullException(nameof(region));
            }

            if (string.IsNullOrWhiteSpace(region))
            {
                throw new ArgumentException("Parameter is an empty string.", nameof(region));
            }

            if (!this.RegionDictionary.ContainsKey(region))
            {
                throw new RegionNotFoundException(region);
            }

            object container = this.RegionDictionary[region]
                               .Item1;

            IRegionAdapter adapter = this.RegionDictionary[region]
                                     .Item2;

            return(adapter.Get(container));
        }