예제 #1
0
        public void Register(Type idType, Type viewType, Type logicType)
        {
            CheckParameters(idType, viewType, logicType);

            var popupAttribute = idType.GetCustomAttribute <PopupAttribute>(true);

            _factories[idType] = new ScreenFactory(idType, viewType, logicType, _register, _resolve, popupAttribute);

            if (_menuManager != null)
            {
                var attribute = idType.GetCustomAttributes(typeof(ScreenMenuItemAttribute), true)
                                .OfType <ScreenMenuItemAttribute>()
                                .FirstOrDefault();
                if (attribute != null)
                {
                    var action = attribute.IsPopup
                        ? new Action(() => Popup(idType))
                        : () => Display(idType);
                    _menuManager.Add(attribute.Path, action, attribute.DisplayName, attribute.IconFilePath);
                }
            }
        }
 public async Task <ApiResponse> Add([FromBody] MenuDto param) =>
 await manager.Add(param);