Esempio n. 1
0
        public void Close(object viewKey)
        {
            if (!_items.ContainsKey(viewKey))
            {
                throw new Exception(string.Format("{0} has not been mapped", viewKey));
            }
            if (!_opened.ContainsKey(viewKey))
            {
                throw new Exception(string.Format("{0} is not opened", viewKey));
            }

            ViewItem     item         = _opened[viewKey];
            MediatorItem mediatorItem = _items[viewKey];

            if (mediatorItem.closeMethod != null)
            {
                mediatorItem.closeMethod.Invoke(item.mediator, null);
            }

            _viewFactory.ReleaseView(item.view);
            _opened.Remove(viewKey);
        }