public MainView(IPresenterFactory presenterFactory)
        {
            _notebook = presenterFactory.InstantiatePresenter<MainNotebook>();
            _notebook.Add(presenterFactory.InstantiatePresenter<MenuPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<ModsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<BlueprintsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<SavegamesPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<TasksPageView>(this));

            PackStart(presenterFactory.InstantiatePresenter<MainHeaderView>());

            var sideBox = new VBox
            {
                MinWidth = 280,
                WidthRequest = 280
            };

            _sidebarContainer = new SidebarContainer();
            sideBox.PackStart(_sidebarContainer, true, true);
            var box = new HBox();

            box.PackStart(_notebook, true);
            box.PackEnd(sideBox);

            PackStart(box, true, true);

            _notebook.HandleSizeChangeOnTabChange = true;
            _notebook.HandleSizeUpdate();
        }
        public MainWindow(IPresenterFactory presenterFactory)
        {
            Title = "ParkitectNexus Client";
            Width = 950;
            Height = 650;
            Icon = App.Images["parkitectnexus_logo-64x64.png"];

            Content = presenterFactory.InstantiatePresenter<MainView>();
        }
Esempio n. 3
0
 public App(IPresenterFactory presenterFactory, IParkitect parkitect, IQueueableTaskManager taskManager,
     ILogger log, IUpdateManager updateManager, Migrator migrator)
 {
     _migrator = migrator;
     _presenterFactory = presenterFactory;
     _parkitect = parkitect;
     _taskManager = taskManager;
     _log = log;
     _updateManager = updateManager;
 }
 public DentalSurgeryVisitPresenter(IRepositoryFactory repositoryFactory, IPresenterFactory presenterFactory)
 {
     this.repositoryFactory = repositoryFactory;
     this.presenterFactory  = presenterFactory;
 }
Esempio n. 5
0
        static IPresenter BuildPresenter(
            HttpContextBase httpContext,
            ITraceContext traceContext,
            IMessageBus messageBus,
            Action<IPresenter> presenterCreatedCallback,
            IPresenterFactory presenterFactory,
            PresenterBinding binding,
            IView viewInstance)
        {
            traceContext.Write(typeof(PresenterBinder), () => string.Format(
                CultureInfo.InvariantCulture,
                "Creating presenter of type {0} for view of type {1}. (The actual view instance is of type {2}.)",
                binding.PresenterType.FullName,
                binding.ViewType.FullName,
                viewInstance.GetType().FullName));

            var presenter = presenterFactory.Create(binding.PresenterType, binding.ViewType, viewInstance);
            presenter.HttpContext = httpContext;
            presenter.Messages = messageBus;
            if (presenterCreatedCallback != null)
            {
                presenterCreatedCallback(presenter);
            }
            return presenter;
        }
Esempio n. 6
0
 public GPPresenter getGPPresenter(Patient patient, IRepositoryFactory factory, IPresenterFactory presenterFactory)
 {
     return(new GPPresenter(patient, factory, presenterFactory));
 }
Esempio n. 7
0
      public MainPresenter(MainGridModel mainGridModel, IMainView view, IMessagesView messagesView, IViewFactory viewFactory,
                           IMessageBoxView messageBoxView, UserStatsDataModel userStatsDataModel, IPresenterFactory presenterFactory,
                           IClientConfiguration clientConfiguration, IProteinService proteinService, IUpdateLogic updateLogic,
                           RetrievalModel retrievalModel, IExternalProcessStarter processStarter,
                           IPreferenceSet prefs, IClientSettingsManager settingsManager)
      {
         _gridModel = mainGridModel;
         //_gridModel.BeforeResetBindings += delegate { _view.DataGridView.FreezeSelectionChanged = true; };
         _gridModel.AfterResetBindings += delegate
                                          {
                                             //_view.DataGridView.FreezeSelectionChanged = false;
                                             DisplaySelectedSlotData();
                                             _view.RefreshControlsWithTotalsData(_gridModel.SlotTotals);
                                          };
         _gridModel.SelectedSlotChanged += (sender, e) =>
                                           {
                                              if (e.Index >= 0 && e.Index < _view.DataGridView.Rows.Count)
                                              {
                                                 _view.DataGridView.Rows[e.Index].Selected = true;
                                                 DisplaySelectedSlotData();
                                              }
                                           };
         _userStatsDataModel = userStatsDataModel;

         // Views
         _view = view;
         _messagesView = messagesView;
         _messageBoxView = messageBoxView;
         //
         _viewFactory = viewFactory;
         _presenterFactory = presenterFactory;
         // Collections
         _clientConfiguration = clientConfiguration;
         _proteinService = proteinService;
         // Logic Services
         _updateLogic = updateLogic;
         _updateLogic.Owner = _view;
         _retrievalModel = retrievalModel;
         _processStarter = processStarter;
         // Data Services
         _prefs = prefs;
         _settingsManager = settingsManager;

         _clientConfiguration.DictionaryChanged += delegate { AutoSaveConfig(); };
      }
Esempio n. 8
0
 static IEnumerable<IPresenter> BuildPresenters(
     HttpContextBase httpContext,
     ITraceContext traceContext,
     IMessageBus messageBus,
     Action<IPresenter> presenterCreatedCallback,
     IPresenterFactory presenterFactory,
     IEnumerable<PresenterBinding> bindings)
 {
     return bindings
         .SelectMany(binding =>
             BuildPresenters(
                 httpContext,
                 traceContext,
                 messageBus,
                 presenterCreatedCallback,
                 presenterFactory,
                 binding));
 }
Esempio n. 9
0
 private static IPresenter BuildPresenter(
     Action<IPresenter> presenterCreatedCallback,
     //IAppState appState,
     IPresenterFactory presenterFactory,
     IEnumerable<PresenterBinding> bindings)
 {
     return bindings
         .Select(binding =>
             BuildPresenters(
                 presenterCreatedCallback,
                 //appState,
                 presenterFactory,
                 binding)).ToList().First();
 }
Esempio n. 10
0
        private static IPresenter BuildPresenters(
            Action<IPresenter> presenterCreatedCallback,
            //IAppState appState,
            IPresenterFactory presenterFactory,
            PresenterBinding binding)
        {
            IView viewToCreateFor = binding.ViewInstance;

            return BuildPresenter(
                presenterCreatedCallback,
                //appState,
                presenterFactory,
                binding,
                viewToCreateFor);
        }
Esempio n. 11
0
 public ApplicationController(IPresenterFactory factory)
 {
     _factory = factory;
 }
Esempio n. 12
0
 protected WebControlView(IPresenterFactory presenterFactory)
 {
     PresenterFactory = presenterFactory;
 }
Esempio n. 13
0
 public StaffServicesPresenter getStaffServicesPresenter(IPresenterFactory presenterFactory, IRepositoryFactory repositoryFactory)
 {
     return(new StaffServicesPresenter(presenterFactory, repositoryFactory));
 }
Esempio n. 14
0
 public DentalSurgeryVisitPresenter getDentalSurgeryVisitPresenter(IRepositoryFactory repositoryFactory, IPresenterFactory presenterFactory)
 {
     return(new DentalSurgeryVisitPresenter(repositoryFactory, presenterFactory));
 }
Esempio n. 15
0
 public RecordTreatmentPresenter getRecordTreatmentPresenter(IPresenterFactory presenterFactory,
                                                             ITreatmentPlanRepository treatmentPlanRepository)
 {
     return(new RecordTreatmentPresenter(presenterFactory, treatmentPlanRepository));
 }
Esempio n. 16
0
 public QuestionnairePresenter getQuestionnairePresenter(Patient patient, IPresenterFactory presenterFactory, IRepositoryFactory repositoryFactory)
 {
     return(new QuestionnairePresenter(patient, presenterFactory, repositoryFactory));
 }
Esempio n. 17
0
 public PatientPresenter getPatientPresenter(
     IPresenterFactory presenterFactory, IRepositoryFactory repositoryFactory)
 {
     return(new PatientPresenter(presenterFactory, repositoryFactory));
 }
Esempio n. 18
0
 protected NavigationState(IPresenterFactory presenterFactory)
 => PresenterFactory = presenterFactory;
Esempio n. 19
0
 public WpfStartUpState(IPresenterFactory presenterFactory, IApplicationData appState)
     : base(presenterFactory)
 {
     _appState = appState;
 }
Esempio n. 20
0
 public RadiantDentalPracticePresenter(
     IPresenterFactory presenterFactory, IRepositoryFactory repositoryFactory)
 {
     this.presenterFactory  = presenterFactory;
     this.repositoryFactory = repositoryFactory;
 }
Esempio n. 21
0
 protected StartUpState(IPresenterFactory presenterFactory)
     : base(presenterFactory)
 {
 }
Esempio n. 22
0
        private static IPresenter BuildPresenter(
            Action<IPresenter> presenterCreatedCallback,
            //IAppState appState,
            IPresenterFactory presenterFactory,
            PresenterBinding binding,
            IView viewInstance)
        {
            Tracing.Verbose(
                "Creating presenter of type {0} for view of type {1}. (The actual view instance is of type {2}.)",
                binding.PresenterType.FullName,
                binding.ViewType.FullName,
                viewInstance.GetType().FullName
                );

            var presenter = presenterFactory.Create(binding.PresenterType, binding.ViewType, viewInstance);

            //presenter.Items = appState;

            if (presenterCreatedCallback != null)
            {
                presenterCreatedCallback(presenter);
            }
            return presenter;
        }
 public RecordTreatmentPresenter(IPresenterFactory presenterFactory, ITreatmentPlanRepository treatmentPlanRepository)
 {
     this.treatmentPlanRepository = treatmentPlanRepository;
     this.presenterFactory        = presenterFactory;
 }
Esempio n. 24
0
        private static IPresenter PerformBinding(
            IView candidate,
            IPresenterDiscoveryStrategy presenterDiscoveryStrategy,
            IAppState appState,
            Action<IPresenter> presenterCreatedCallback,
            IPresenterFactory presenterFactory)
        {
            var bindings = GetBindings(
                candidate,
                presenterDiscoveryStrategy);

            var newPresenter = BuildPresenter(
                presenterCreatedCallback,
                //appState,
                presenterFactory,
                new[] {bindings});

            return newPresenter;
        }
Esempio n. 25
0
        public MainPresenter(MainGridModel mainGridModel, IMainView view, IMessagesView messagesView, IViewFactory viewFactory,
                             IMessageBoxView messageBoxView, UserStatsDataModel userStatsDataModel, IPresenterFactory presenterFactory,
                             IClientConfiguration clientConfiguration, IProteinService proteinService, IUpdateLogic updateLogic,
                             Core.ScheduledTasks.RetrievalModel retrievalModel, IExternalProcessStarter processStarter,
                             IPreferenceSet prefs, ClientSettingsManager settingsManager)
        {
            _gridModel = mainGridModel;
            _gridModel.AfterResetBindings += (sender, e) =>
            {
                // run asynchronously so binding operation can finish
                _view.BeginInvoke(new Action(() =>
                {
                    DisplaySelectedSlotData();
                    _view.RefreshControlsWithTotalsData(_gridModel.SlotTotals);
                }), null);
            };
            _gridModel.SelectedSlotChanged += (sender, e) =>
            {
                if (e.Index >= 0 && e.Index < _view.DataGridView.Rows.Count)
                {
                    // run asynchronously so binding operation can finish
                    _view.BeginInvoke(new Action(() =>
                    {
                        _view.DataGridView.Rows[e.Index].Selected = true;
                        DisplaySelectedSlotData();
                    }), null);
                }
            };
            _userStatsDataModel = userStatsDataModel;

            // Views
            _view           = view;
            _messagesView   = messagesView;
            _messageBoxView = messageBoxView;
            //
            _viewFactory      = viewFactory;
            _presenterFactory = presenterFactory;
            // Collections
            _clientConfiguration = clientConfiguration;
            _proteinService      = proteinService;
            // Logic Services
            _updateLogic       = updateLogic;
            _updateLogic.Owner = _view;
            _retrievalModel    = retrievalModel;
            _processStarter    = processStarter;
            // Data Services
            _prefs           = prefs;
            _settingsManager = settingsManager;

            _clientConfiguration.ConfigurationChanged += delegate { AutoSaveConfig(); };
        }
Esempio n. 26
0
        static IEnumerable<IPresenter> PerformBinding(
            IEnumerable<object> hosts,
            IEnumerable<IView> candidates,
            IPresenterDiscoveryStrategy presenterDiscoveryStrategy,
            HttpContextBase httpContext,
            ITraceContext traceContext,
            IMessageBus messageBus,
            Action<IPresenter> presenterCreatedCallback,
            IPresenterFactory presenterFactory)
        {
            var bindings = GetBindings(
                hosts,
                candidates,
                presenterDiscoveryStrategy,
                traceContext);

            var newPresenters = BuildPresenters(
                httpContext,
                traceContext,
                messageBus,
                presenterCreatedCallback,
                presenterFactory,
                bindings);

            return newPresenters;
        }
Esempio n. 27
0
 public Output(IPresenterFactory presenterFactory, IEnumerable <IOutputStream> streams)
 {
     _streams         = streams.ToList();
     PresenterFactory = presenterFactory;
 }
Esempio n. 28
0
        static IEnumerable<IPresenter> BuildPresenters(
            HttpContextBase httpContext,
            ITraceContext traceContext,
            IMessageBus messageBus,
            Action<IPresenter> presenterCreatedCallback,
            IPresenterFactory presenterFactory,
            PresenterBinding binding)
        {
            IEnumerable<IView> viewsToCreateFor;

            switch (binding.BindingMode)
            {
                case BindingMode.Default:
                    viewsToCreateFor = binding.ViewInstances;
                    break;
                case BindingMode.SharedPresenter:
                    viewsToCreateFor = new[]
                    {
                        CreateCompositeView(binding.ViewType, binding.ViewInstances, traceContext)
                    };
                    break;
                default:
                    throw new NotSupportedException(string.Format(
                        CultureInfo.InvariantCulture,
                        "Binding mode {0} is not supported by this method.",
                        binding.BindingMode));
            }

            return viewsToCreateFor.Select(viewInstance =>
                BuildPresenter(
                    httpContext,
                    traceContext,
                    messageBus,
                    presenterCreatedCallback,
                    presenterFactory,
                    binding,
                    viewInstance));
        }
Esempio n. 29
0
 public StaffServicesPresenter(IPresenterFactory presenterFactory, IRepositoryFactory repositoryFactory)
 {
     this.presenterFactory  = presenterFactory;
     this.repositoryFactory = repositoryFactory;
 }
Esempio n. 30
0
 public MainViewPresenterFacade(IPresenterFactory<IPresenter<ICreateView>> createPresenterFactory, IPresenterFactory<IPresenter<IDetailView>> detailPresenterFactory)
 {
     _createPresenterFactory = createPresenterFactory;
     _detailPresenterFactory = detailPresenterFactory;
 }
Esempio n. 31
0
 public WelcomeState(IPresenterFactory presenterFactory)
     : base(presenterFactory)
     => _presenter = PresenterFactory.Build <WelcomePresenter>();