Пример #1
0
        public static IArea CreateArea(this IController controller, Enum id)
        {
            var area = new Area(AreaIdFactory.CreateIdFrom(id), controller);

            controller.AddArea(area);

            return(area);
        }
        public static IArea CreateArea(this IController controller, Enum id)
        {
            if (controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }

            var area = new Area(AreaIdFactory.Create(id), controller);

            controller.AddArea(area);

            return(area);
        }
        private void ParseAreas()
        {
            var roomsElement = _configuration.Root.Element("Areas");

            foreach (XElement areaElement in roomsElement.Elements())
            {
                try
                {
                    _controller.AddArea(ParseArea(areaElement));
                }
                catch (Exception exception)
                {
                    _controller.Logger.Warning(exception, "Unable to parse area node '{0}'.", areaElement.Name);
                }
            }
        }