Пример #1
0
 public FahClientSettingsPresenter(FahClientSettingsModel model, ILogger logger, MessageBoxPresenter messageBox)
     : base(model)
 {
     Model      = model ?? throw new ArgumentNullException(nameof(model));
     Logger     = logger ?? NullLogger.Instance;
     MessageBox = messageBox ?? NullMessageBoxPresenter.Instance;
 }
Пример #2
0
 protected ExceptionPresenter(ILogger logger, MessageBoxPresenter messageBox, IDictionary <string, string> properties, string reportUrl)
 {
     Logger     = logger ?? NullLogger.Instance;
     MessageBox = messageBox ?? NullMessageBoxPresenter.Instance;
     Properties = properties;
     ReportUrl  = reportUrl;
 }
Пример #3
0
 public PreferencesPresenter(PreferencesModel model, ILogger logger, MessageBoxPresenter messageBox, ExceptionPresenterFactory exceptionPresenter)
     : base(model)
 {
     Model              = model ?? throw new ArgumentNullException(nameof(model));
     Logger             = logger ?? NullLogger.Instance;
     MessageBox         = messageBox ?? NullMessageBoxPresenter.Instance;
     ExceptionPresenter = exceptionPresenter ?? NullExceptionPresenterFactory.Instance;
 }
Пример #4
0
 public ApplicationUpdatePresenter(ApplicationUpdateModel model, ILogger logger, IPreferences preferences, MessageBoxPresenter messageBox)
     : base(model)
 {
     Model       = model;
     Logger      = logger ?? NullLogger.Instance;
     Preferences = preferences ?? new InMemoryPreferencesProvider();
     MessageBox  = messageBox ?? NullMessageBoxPresenter.Instance;
 }
Пример #5
0
 public BenchmarksPresenter(BenchmarksModel model, ILogger logger, MessageBoxPresenter messageBox) : base(model)
 {
     Model      = model ?? throw new ArgumentNullException(nameof(model));
     Logger     = logger ?? NullLogger.Instance;
     MessageBox = messageBox ?? NullMessageBoxPresenter.Instance;
 }
Пример #6
0
 public MockFormBenchmarksPresenter(BenchmarksModel model, MessageBoxPresenter messageBox) : base(model, null, messageBox)
 {
 }
 public WorkUnitHistoryPresenter(WorkUnitHistoryModel model, ILogger logger, IServiceScopeFactory serviceScopeFactory, MessageBoxPresenter messageBox,
                                 IProteinService proteinService)
     : base(model)
 {
     Model  = model;
     Logger = logger ?? NullLogger.Instance;
     ServiceScopeFactory = serviceScopeFactory ?? NullServiceScopeFactory.Instance;
     MessageBox          = messageBox ?? NullMessageBoxPresenter.Instance;
     ProteinService      = proteinService ?? NullProteinService.Instance;
 }
Пример #8
0
 public MockDialogFahClientSettingsPresenter(FahClientSettingsModel model, MessageBoxPresenter messageBox) : base(model, null, messageBox)
 {
 }
Пример #9
0
        public MainPresenter(MainModel model, ILogger logger, IServiceScopeFactory serviceScopeFactory, MessageBoxPresenter messageBox,
                             ClientConfiguration clientConfiguration, IProteinService proteinService, EocStatsScheduledTask eocStatsScheduledTask)
            : base(model)
        {
            Model  = model;
            Logger = logger ?? NullLogger.Instance;
            ServiceScopeFactory = serviceScopeFactory ?? NullServiceScopeFactory.Instance;
            MessageBox          = messageBox ?? NullMessageBoxPresenter.Instance;
            ClientConfiguration = clientConfiguration;
            ProteinService      = proteinService ?? NullProteinService.Instance;

            UserStatsDataModel = new UserStatsDataModel(Form, Model.Preferences, eocStatsScheduledTask);
            Preferences        = Model.Preferences;
            GridModel          = new MainGridModel(Form, Model.Preferences, clientConfiguration);
            GridModel.Load();

            GridModel.AfterResetBindings += (s, e) =>
            {
                // Create a local reference before handing off to BeginInvoke.
                // This ensures that the BeginInvoke action uses the state of GridModel properties available now,
                // not the state of GridModel properties when the BeginInvoke action is executed (at a later time).
                var selectedSlot = GridModel.SelectedSlot;
                var slotTotals   = GridModel.SlotTotals;
                // run asynchronously so binding operation can finish
                Form.BeginInvoke(new Action(() =>
                {
                    Model.GridModelSelectedSlotChanged(selectedSlot);
                    Model.GridModelSlotTotalsChanged(slotTotals);
                }), null);
            };
            GridModel.PropertyChanged += (s, e) =>
            {
                switch (e.PropertyName)
                {
                case nameof(MainGridModel.SelectedSlot):
                    // Create a local reference before handing off to BeginInvoke.
                    // This ensures that the BeginInvoke action uses the state of GridModel properties available now,
                    // not the state of GridModel properties when the BeginInvoke action is executed (at a later time).
                    var selectedSlot = GridModel.SelectedSlot;
                    // run asynchronously so binding operation can finish
                    Form.BeginInvoke(new Action(() => Model.GridModelSelectedSlotChanged(selectedSlot)), null);
                    break;
                }
            };

            _settingsManager = new ClientSettingsManager(Logger);

            ClientConfiguration.ClientConfigurationChanged += (s, e) => AutoSaveConfig();
        }
Пример #10
0
 public ApplicationUpdatePresenterFactory(ILogger logger, IPreferences preferences, MessageBoxPresenter messageBox)
 {
     Logger      = logger ?? NullLogger.Instance;
     Preferences = preferences ?? new InMemoryPreferencesProvider();
     MessageBox  = messageBox ?? NullMessageBoxPresenter.Instance;
 }
Пример #11
0
 public FahClientSettingsPresenterFactory(ILogger logger, MessageBoxPresenter messageBox)
 {
     Logger     = logger ?? NullLogger.Instance;
     MessageBox = messageBox ?? NullMessageBoxPresenter.Instance;
 }
Пример #12
0
 public DefaultExceptionPresenterFactory(ILogger logger, MessageBoxPresenter messageBox, IDictionary <string, string> properties, string reportUrl)
     : base(logger, messageBox, properties, reportUrl)
 {
 }
 public MockDialogApplicationUpdatePresenter(ApplicationUpdateModel model, MessageBoxPresenter messageBox) : base(model, null, null, messageBox)
 {
 }