Esempio n. 1
0
        public static IList <Controller> CollectControllers(this XpandModuleBase moduleBase, Predicate <ITypeInfo> filterPredicate)
        {
            ControllersManager controllersManager = moduleBase.ModuleManager.ControllersManager;
            IList <Controller> controllers        = filterPredicate != null
                                                ? controllersManager.CollectControllers(filterPredicate)
                                                : controllersManager.CollectControllers(
                info =>
                moduleBase.AssemblyName ==
                ReflectionHelper.GetAssemblyName(info.AssemblyInfo.Assembly));

            return(controllers);
        }
Esempio n. 2
0
        IControlsCreatedHandler IFrameCreationHandler.CreateFrame(Action <Frame> created)
        {
            var controllersManager = new ControllersManager();

            controllersManager.CollectControllers(info => true);
            _collectedControllers = controllersManager.CreateControllers(typeof(Controller));
            _frame = new Frame(_xafApplication, TemplateContext.View,
                               _collectedControllers.Where(
                                   controller => controller.GetType() != typeof(ScriptRecorderControllerBase)).ToList());
            if (_view == null)
            {
                ((IViewCreationHandler)this).CreateDetailView();
            }
            _frame.SetView(_view);
            if (created != null)
            {
                created.Invoke(_frame);
            }
            return(this);
        }