Exemplo n.º 1
0
        /// <summary>
        /// Checks if the designer document has changed and asks the user to confirm the change. Will save current layout if requested. Document is marked clean if the change is not cancelled.
        /// </summary>
        /// <param name="e">The event args that allow for cancellation.</param>
        /// <returns>Value indicating whether the change is confirmed or not.</returns>
        private bool CheckForChangesAndConfirmDisposition(CancelEventArgs e)
        {
            bool confirmed = true;

            if (this.currentLayout != null && this.IsDocumentDirty())
            {
                IMessageBoxView  messageBox = this.container.Resolve <IMessageBoxView>();
                MessageBoxResult result     = messageBox.Show(string.Format(CultureInfo.InvariantCulture, PresenterResources.SaveLayoutChanges, this.SaveLayoutName()), PresenterResources.MicrosoftWord, MessageBoxViewButtons.YesNoCancel, MessageBoxViewIcon.Warning);
                if (result == MessageBoxResult.Yes)
                {
                    this.SaveChanges();
                }
                else if (result == MessageBoxResult.No)
                {
                    if (this.RenameIsPending())
                    {
                        this.SetViewLayoutList();
                    }

                    this.SetDocumentClean();
                }

                confirmed = result == MessageBoxResult.Yes || result == MessageBoxResult.No;

                e.Cancel = !confirmed;
            }

            return(confirmed);
        }
        public void OnHelpRequested(EventArgs e)
        {
            if (_shellModuleService.ActiveModule == _module)
            {
                EventHandler <HelpRequestedEventArgs> temp = HelpRequested;

                ShellConfigurationSection config = ConfigurationManager.GetSection(ShellConfigurationSection.SectionKey) as ShellConfigurationSection;

                HelpRequestedEventArgs args = new HelpRequestedEventArgs();
                args.HelpBaseUri = config.HelpBaseUri;

                if (temp != null)
                {
                    temp(this, args);
                }
                else
                {
                    args.Cancel = true;
                }

                if (args.Cancel)
                {
                    IMessageBoxView messageBoxView = _workItem.SmartParts.AddNew <MessageBoxView>();
                    messageBoxView.Show(_shellView.Model.Module.Title, StringResources.No_Help_Message, null, Infrastructure.MessageBoxButton.Ok, Infrastructure.MessageBoxImage.Information);
                }
            }
        }
 public void Init()
 {
    _settingsView = MockRepository.GenerateMock<ILegacyClientSetupView>();
    _settingsView.Stub(x => x.FindValidatingControls()).Return(new List<IValidatingControl>());
    _networkOps = MockRepository.GenerateMock<INetworkOps>();
    _messageBoxView = MockRepository.GenerateMock<IMessageBoxView>();
    _folderBrowserView = MockRepository.GenerateMock<IFolderBrowserView>();
 }
Exemplo n.º 4
0
 public void Init()
 {
     _settingsView = MockRepository.GenerateMock <ILegacyClientSetupView>();
     _settingsView.Stub(x => x.FindValidatingControls()).Return(new List <IValidatingControl>());
     _networkOps        = MockRepository.GenerateMock <INetworkOps>();
     _messageBoxView    = MockRepository.GenerateMock <IMessageBoxView>();
     _folderBrowserView = MockRepository.GenerateMock <IFolderBrowserView>();
 }
Exemplo n.º 5
0
 public LegacyClientSetupPresenter(ILegacyClientSetupView settingsView, INetworkOps networkOps, IMessageBoxView messageBoxView, IFolderBrowserView folderBrowserView)
 {
     _settingsView = settingsView;
      _settingsView.AttachPresenter(this);
      _networkOps = networkOps;
      _messageBoxView = messageBoxView;
      _folderBrowserView = folderBrowserView;
      _validatingControls = _settingsView.FindValidatingControls();
 }
 public LegacyClientSetupPresenter(ILegacyClientSetupView settingsView, INetworkOps networkOps, IMessageBoxView messageBoxView, IFolderBrowserView folderBrowserView)
 {
     _settingsView = settingsView;
     _settingsView.AttachPresenter(this);
     _networkOps         = networkOps;
     _messageBoxView     = messageBoxView;
     _folderBrowserView  = folderBrowserView;
     _validatingControls = _settingsView.FindValidatingControls();
 }
        public MessageBoxResult ShowNotAuhtorizedMessageBox()
        {
            IMessageBoxView messageBoxView = _workItem.SmartParts.AddNew <MessageBoxView>();

            return(messageBoxView.Show(StringResources.Authorization_NotAuhtorized
                                       , StringResources.Authorization_Message
                                       , null
                                       , Infrastructure.MessageBoxButton.Ok
                                       , Infrastructure.MessageBoxImage.Warning));
        }
Exemplo n.º 8
0
        public void Init()
        {
            _prefs          = MockRepository.GenerateStub <IPreferenceSet>();
            _queryContainer = MockRepository.GenerateStub <IQueryParametersContainer>();
            _view           = MockRepository.GenerateMock <IHistoryView>();
            _viewFactory    = MockRepository.GenerateMock <IViewFactory>();
            _messageBoxView = MockRepository.GenerateMock <IMessageBoxView>();

            _database = MockRepository.GenerateMock <IUnitInfoDatabase>();
            _database.Stub(x => x.Connected).Return(true);
            _model = new HistoryPresenterModel(_database);
        }
Exemplo n.º 9
0
        public FahClientSetupPresenter(IFahClientSetupView settingsView, IFahClientInterface fahClient, IMessageBoxView messageBoxView)
        {
            _settingsView = settingsView;
             _settingsView.AttachPresenter(this);
             _fahClient = fahClient;
             _messageBoxView = messageBoxView;
             _validatingControls = _settingsView.FindValidatingControls();

             // wire events
             _fahClient.ConnectedChanged += ConnectedChanged;
             _fahClient.MessageUpdated += MessageUpdated;
        }
Exemplo n.º 10
0
      public void Init()
      {
         _prefs = MockRepository.GenerateStub<IPreferenceSet>();
         _queryCollection = MockRepository.GenerateStub<IQueryParametersCollection>();
         _view = MockRepository.GenerateMock<IHistoryView>();
         _viewFactory = MockRepository.GenerateMock<IViewFactory>();
         _messageBoxView = MockRepository.GenerateMock<IMessageBoxView>();

         _database = MockRepository.GenerateMock<IUnitInfoDatabase>();
         _database.Stub(x => x.Connected).Return(true);
         _model = new HistoryPresenterModel(_database);
      }
Exemplo n.º 11
0
        internal FahClientSetupPresenter(IFahClientSetupView settingsView, IMessageConnection messageConnection, IMessageBoxView messageBoxView, TaskScheduler taskScheduler)
        {
            _settingsView = settingsView;
            _settingsView.AttachPresenter(this);
            _messageConnection  = messageConnection;
            _messageBoxView     = messageBoxView;
            _validatingControls = _settingsView.FindValidatingControls();
            var fahClientEventTaskScheduler = taskScheduler ?? TaskScheduler.FromCurrentSynchronizationContext();

            // wire events - these may be raised on a thread other than the UI thread
            _messageConnection.ConnectedChanged += (s, e) => Task.Factory.StartNew(() => ConnectedChanged(e), CancellationToken.None, TaskCreationOptions.None, fahClientEventTaskScheduler);
            _messageConnection.MessageReceived  += (s, e) => Task.Factory.StartNew(() => MessageReceived(e), CancellationToken.None, TaskCreationOptions.None, fahClientEventTaskScheduler);
        }
Exemplo n.º 12
0
 public HistoryPresenter(IPreferenceSet prefs, IQueryParametersCollection queryCollection, IHistoryView view, 
     IQueryView queryView, IOpenFileDialogView openFileView, ISaveFileDialogView saveFileView,
     IMessageBoxView messageBoxView, HistoryPresenterModel model)
 {
     _prefs = prefs;
      _queryCollection = queryCollection;
      _view = view;
      _queryView = queryView;
      _openFileView = openFileView;
      _saveFileView = saveFileView;
      _messageBoxView = messageBoxView;
      _model = model;
 }
Exemplo n.º 13
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(); };
        }
        public BenchmarksForm(IPreferenceSet prefs, IProteinService proteinService, IProteinBenchmarkService benchmarkService,
                              IClientConfiguration clientConfiguration, IMessageBoxView messageBoxView, IExternalProcessStarter processStarter)
        {
            _prefs               = prefs;
            _proteinService      = proteinService;
            _benchmarkService    = benchmarkService;
            _graphColors         = _prefs.Get <List <Color> >(Preference.GraphColors);
            _clientConfiguration = clientConfiguration;
            _messageBoxView      = messageBoxView;
            _processStarter      = processStarter;
            _zedGraphManager     = new ZedGraphManager();

            InitializeComponent();
            StartPosition = FormStartPosition.Manual;
        }
Exemplo n.º 15
0
        public MainPresenter(MainGridModel mainGridModel, IMainView view, IMessagesView messagesView, IMessageBoxView messageBoxView,
            IOpenFileDialogView openFileDialogView, ISaveFileDialogView saveFileDialogView,
            IClientDictionary clientDictionary, IProteinBenchmarkCollection benchmarkCollection,
            IProteinDictionary proteinDictionary, IUnitInfoCollection unitInfoCollection, IUpdateLogic updateLogic,
            RetrievalLogic retrievalLogic, 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();
                                              }
                                           };

             // Views
             _view = view;
             _messagesView = messagesView;
             _messageBoxView = messageBoxView;
             _openFileDialogView = openFileDialogView;
             _saveFileDialogView = saveFileDialogView;
             // Collections
             _clientDictionary = clientDictionary;
             _benchmarkCollection = benchmarkCollection;
             _proteinDictionary = proteinDictionary;
             _unitInfoCollection = unitInfoCollection;
             // Logic Services
             _updateLogic = updateLogic;
             _updateLogic.Owner = _view;
             _retrievalLogic = retrievalLogic;
             _retrievalLogic.Initialize();
             _processStarter = processStarter;
             // Data Services
             _prefs = prefs;
             _settingsManager = settingsManager;

             _clientDictionary.ClientEdited += HandleClientEdit;
             _clientDictionary.DictionaryChanged += delegate { AutoSaveConfig(); };
        }
        private void IsCommonWorkspaceEnabledCheckBoxClick(object sender, RoutedEventArgs e)
        {
            IMessageBoxView view = WorkItem.SmartParts.AddNew <MessageBoxView>();

            if (view.Show(StringResources.Settings_PopularCommonWorkspace, StringResources.Settings_CloseAllWindows, null, Infrastructure.MessageBoxButton.YesNo, Infrastructure.MessageBoxImage.Question) == Infrastructure.MessageBoxResult.Yes)
            {
                if (CloseAllWorkspaces != null)
                {
                    CloseAllWorkspaces(this, new EventArgs());
                }
            }
            else
            {
                isCommonWorkspaceEnabledCheckBox.IsChecked = !isCommonWorkspaceEnabledCheckBox.IsChecked;
            }
        }
 public HistoryPresenter(IPreferenceSet prefs,
                         IQueryParametersContainer queryContainer,
                         IHistoryView view,
                         IViewFactory viewFactory,
                         IMessageBoxView messageBoxView,
                         IUnitInfoDatabase database,
                         HistoryPresenterModel model)
 {
     _prefs          = prefs;
     _queryContainer = queryContainer;
     _view           = view;
     _viewFactory    = viewFactory;
     _messageBoxView = messageBoxView;
     _database       = database;
     _model          = model;
 }
Exemplo n.º 18
0
 public HistoryPresenter(IPreferenceSet prefs, 
                         IQueryParametersCollection queryCollection, 
                         IHistoryView view, 
                         IViewFactory viewFactory, 
                         IMessageBoxView messageBoxView, 
                         IUnitInfoDatabase database,
                         HistoryPresenterModel model)
 {
    _prefs = prefs;
    _queryCollection = queryCollection;
    _view = view;
    _viewFactory = viewFactory;
    _messageBoxView = messageBoxView;
    _database = database;
    _model = model;
 }
Exemplo n.º 19
0
        /// <summary>
        /// Handles the <see cref="ILayoutDesignerView.LayoutDelete"/> event.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">The event arguments.</param>
        private void HandleLayoutDelete(object sender, LayoutItemEventArgs e)
        {
            IMessageBoxView  messageBox = this.container.Resolve <IMessageBoxView>();
            MessageBoxResult result     = messageBox.Show(string.Format(CultureInfo.InvariantCulture, PresenterResources.ConfirmLayoutDeletion, this.SaveLayoutName()), PresenterResources.MicrosoftWord, MessageBoxViewButtons.YesNo, MessageBoxViewIcon.Warning);

            if (result == MessageBoxResult.Yes)
            {
                int index = 0;
                LayoutInformation[] layouts = this.GetLayoutList().ToArray();
                for (int i = 0; i < layouts.Length; i++)
                {
                    if (e.LayoutItem.Name == layouts[i].Name)
                    {
                        index = i;
                        break;
                    }
                }

                int nextIndex = -1;
                if (index < layouts.Length - 1)
                {
                    nextIndex = index + 1;
                }
                else if (index >= layouts.Length - 1)
                {
                    nextIndex = index - 1;
                }

                this.manager.SystemTemplate.DeleteLayout(e.LayoutItem.Name);
                this.manager.SystemTemplate.Save();
                if (this.CurrentLayoutIsTemporary())
                {
                    this.RemoveTemporaryLayout();
                }

                this.SetDocumentClean();
                this.SetViewLayoutList();

                if (nextIndex != -1)
                {
                    this.ChangeDisplayedLayout(layouts[nextIndex]);
                }

                this.SetEditorControls();
            }
        }
Exemplo n.º 20
0
        private void DispatcherUnhandledExceptionEventHandler(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            e.Handled = true;

            Exception ex = e.Exception;

            if (ex is TargetInvocationException)
            {
                if (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
            }

            IMessageBoxView messageBoxView = WorkItem.SmartParts.AddNew <MessageBoxView>();

            messageBoxView.Show(StringResources.Unhandled_Exception_Text, ex.Message, ex.ToString(), Infrastructure.MessageBoxButton.Ok, Infrastructure.MessageBoxImage.Error);
        }
Exemplo n.º 21
0
        public void ActionExecutedEventHandler(object sender, DataEventArgs <ShellDrillDownMenuItem> e)
        {
            ShellDrillDownMenuItem action = e.Data;

            if (!action.IsAuthorized)
            {
                IMessageBoxView messageBoxView = WorkItem.SmartParts.AddNew <MessageBoxView>();
                messageBoxView.Show(StringResources.Authorization_NotAuhtorized
                                    , StringResources.Authorization_Message
                                    , null
                                    , Infrastructure.MessageBoxButton.Ok
                                    , Infrastructure.MessageBoxImage.Warning);

                return;
            }
            else if (!action.IsEnabled)
            {
                return;
            }

            try
            {
                _shellView.ShowProgress();

                try
                {
                    IActionCatalogService actionCatalog = action.WorkItem.Services.Get <IActionCatalogService>();
                    actionCatalog.Execute(action.Id, action.WorkItem, this, action.Parameters);
                }
                finally
                {
                    _shellView.HideProgress();
                }
            }
            catch (Exception ex)
            {
                IMessageBoxView messageBoxView = WorkItem.SmartParts.AddNew <MessageBoxView>();
                messageBoxView.Show(StringResources.ActionException_Text, ex.Message, ex.ToString(), Infrastructure.MessageBoxButton.Ok, Infrastructure.MessageBoxImage.Error);
            }
        }
Exemplo n.º 22
0
 /// <summary>
 /// View для контролера
 /// </summary>
 /// <param name="view">Представление</param>
 public override void SetControllerView(IView view)
 {
     _view = (IMessageBoxView)view;
 }
Exemplo n.º 23
0
        public void Init()
        {
            _prefs = MockRepository.GenerateStub<IPreferenceSet>();
             _queryCollection = MockRepository.GenerateStub<IQueryParametersCollection>();
             _view = MockRepository.GenerateMock<IHistoryView>();
             _queryView = MockRepository.GenerateMock<IQueryView>();
             _openFileView = MockRepository.GenerateMock<IOpenFileDialogView>();
             _saveFileView = MockRepository.GenerateMock<ISaveFileDialogView>();
             _messageBoxView = MockRepository.GenerateMock<IMessageBoxView>();

             _database = MockRepository.GenerateMock<IUnitInfoDatabase>();
             _model = new HistoryPresenterModel(_database);
        }
Exemplo n.º 24
0
        public void StartMenuItemExecutedEventHandler(object sender, StartMenuItemExecutedEventArgs e)
        {
            ShellMenuItem shellMenuItem = new ShellMenuItem();

            shellMenuItem.Id           = e.MenuItem.Id;
            shellMenuItem.EventTopic   = e.MenuItem.EventTopic;
            shellMenuItem.Caption      = e.MenuItem.Caption;
            shellMenuItem.IsAuthorized = e.MenuItem.IsAuthorized;
            shellMenuItem.IsEnabled    = e.MenuItem.IsEnabled;
            shellMenuItem.Parameters   = e.MenuItem.Parameters;
            shellMenuItem.Operation    = e.MenuItem.Operation;
            shellMenuItem.AssemblyFile = e.MenuItem.AssemblyFile;

            if (!shellMenuItem.IsAuthorized)
            {
                IMessageBoxView messageBoxView = WorkItem.SmartParts.AddNew <MessageBoxView>();
                messageBoxView.Show(StringResources.Authorization_NotAuhtorized
                                    , StringResources.Authorization_Message
                                    , null
                                    , Infrastructure.MessageBoxButton.Ok
                                    , Infrastructure.MessageBoxImage.Warning);

                return;
            }

            try
            {
                _shellView.ShowProgress();

                try
                {
                    if (!string.IsNullOrEmpty(shellMenuItem.AssemblyFile))
                    {
                        ModuleInfo info = new ModuleInfo(shellMenuItem.AssemblyFile);
                        ModuleLoaderService.Load(ShellModuleService.GetWorkItem(e.Module), info);
                    }

                    MenuItemExecutedEventArgs mappedEventArgs = new MenuItemExecutedEventArgs();
                    mappedEventArgs.MenuItem        = shellMenuItem;
                    mappedEventArgs.OpenInNewWindow = (e.StartOption == StartOption.NewWindow || e.StartOption == StartOption.Dashboard);

                    ShellInteractionService interactionService = ShellModuleService.GetWorkItem(e.Module).Services.Get <IShellInteractionService>() as ShellInteractionService;
                    interactionService.OnMenuItemExecuted(mappedEventArgs);

                    if (!string.IsNullOrEmpty(shellMenuItem.EventTopic))
                    {
                        EventTopic itemTopic = WorkItem.RootWorkItem.EventTopics.Get(shellMenuItem.EventTopic);

                        if (itemTopic != null)
                        {
                            itemTopic.Fire(this, mappedEventArgs, WorkItem.RootWorkItem, PublicationScope.Global);
                        }
                    }
                }
                finally
                {
                    _shellView.HideProgress();
                }
            }
            catch (Exception ex)
            {
                IMessageBoxView messageBoxView = WorkItem.SmartParts.AddNew <MessageBoxView>();
                messageBoxView.Show(StringResources.ActionException_Text, ex.Message, ex.ToString(), Infrastructure.MessageBoxButton.Ok, Infrastructure.MessageBoxImage.Error);
            }
        }
Exemplo n.º 25
0
 public UpdateLogic(IPreferenceSet prefs, IMessageBoxView messageBoxView)
 {
    _prefs = prefs;
    _messageBoxView = messageBoxView;
 }
Exemplo n.º 26
0
 public UpdateLogic(IPreferenceSet prefs, IMessageBoxView messageBoxView)
 {
     _prefs          = prefs;
     _messageBoxView = messageBoxView;
 }
Exemplo n.º 27
0
 public FahClientSetupPresenter(IFahClientSetupView settingsView, IMessageConnection messageConnection, IMessageBoxView messageBoxView)
    : this(settingsView, messageConnection, messageBoxView, null)
 {
    
 }
Exemplo n.º 28
0
        /// <summary>
        /// Displays a question to the user which has only a Yes or No answer.
        /// </summary>
        /// <param name="message">The text of the question.</param>
        /// <returns><c>True</c> if the user responds with a Yes, <c>false</c> otherwise.</returns>
        public bool AskYesNoQuestion(string message)
        {
            IMessageBoxView msgbox = this.container.Resolve <IMessageBoxView>();

            return(msgbox.Show(message, PresenterResources.MicrosoftWord, MessageBoxViewButtons.YesNo, MessageBoxViewIcon.Warning) == MessageBoxResult.Yes);
        }
Exemplo n.º 29
0
      internal FahClientSetupPresenter(IFahClientSetupView settingsView, IMessageConnection messageConnection, IMessageBoxView messageBoxView, TaskScheduler taskScheduler)
      {
         _settingsView = settingsView;
         _settingsView.AttachPresenter(this);
         _messageConnection = messageConnection;
         _messageBoxView = messageBoxView;
         _validatingControls = _settingsView.FindValidatingControls();
         var fahClientEventTaskScheduler = taskScheduler ?? TaskScheduler.FromCurrentSynchronizationContext();

         // wire events - these may be raised on a thread other than the UI thread
         _messageConnection.ConnectedChanged += (s, e) => Task.Factory.StartNew(() => ConnectedChanged(e), CancellationToken.None, TaskCreationOptions.None, fahClientEventTaskScheduler);
         _messageConnection.MessageReceived += (s, e) => Task.Factory.StartNew(() => MessageReceived(e), CancellationToken.None, TaskCreationOptions.None, fahClientEventTaskScheduler);
      }
Exemplo n.º 30
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(); };
      }
Exemplo n.º 31
0
        public BenchmarksForm(IPreferenceSet prefs, IProteinDictionary proteinDictionary, IProteinBenchmarkCollection benchmarkCollection,
            IClientDictionary clientDictionary, IMessageBoxView messageBoxView, IExternalProcessStarter processStarter)
        {
            _prefs = prefs;
             _proteinDictionary = proteinDictionary;
             _benchmarkCollection = benchmarkCollection;
             _graphColors = _prefs.Get<List<Color>>(Preference.GraphColors);
             _clientDictionary = clientDictionary;
             _messageBoxView = messageBoxView;
             _processStarter = processStarter;
             _zedGraphManager = new ZedGraphManager();

             InitializeComponent();
        }
Exemplo n.º 32
0
 public FahClientSetupPresenter(IFahClientSetupView settingsView, IMessageConnection messageConnection, IMessageBoxView messageBoxView)
     : this(settingsView, messageConnection, messageBoxView, null)
 {
 }
        public MessageBoxResult ShowMessageBox(string caption, string message, string details, MessageBoxButton button, MessageBoxImage image)
        {
            IMessageBoxView view = _workItem.SmartParts.AddNew <MessageBoxView>();

            return(view.Show(caption, message, details, button, image));
        }
Exemplo n.º 34
0
      public BenchmarksForm(IPreferenceSet prefs, IProteinService proteinService, IProteinBenchmarkCollection benchmarkCollection,
                            IClientConfiguration clientConfiguration, IMessageBoxView messageBoxView, IExternalProcessStarter processStarter)
      {
         _prefs = prefs;
         _proteinService = proteinService;
         _benchmarkCollection = benchmarkCollection;
         _graphColors = _prefs.Get<List<Color>>(Preference.GraphColors);
         _clientConfiguration = clientConfiguration;
         _messageBoxView = messageBoxView;
         _processStarter = processStarter;
         _zedGraphManager = new ZedGraphManager();

         InitializeComponent();
         StartPosition = FormStartPosition.Manual;
      }