Exemplo n.º 1
0
      public void Load(IPreferenceSet prefs)
      {
         var clientRetrievalTask = prefs.Get<ClientRetrievalTask>(Preference.ClientRetrievalTask);
         SyncTimeMinutes = clientRetrievalTask.Interval;
         SyncOnSchedule = clientRetrievalTask.Enabled;
         SyncOnLoad = clientRetrievalTask.ProcessingMode == ProcessingMode.Serial;
         AllowRunningAsync = prefs.Get<bool>(Preference.AllowRunningAsync);

         var webGenerationTask = prefs.Get<WebGenerationTask>(Preference.WebGenerationTask);
         GenerateWeb = webGenerationTask.Enabled;
         GenerateInterval = webGenerationTask.Interval;
         WebGenAfterRefresh = webGenerationTask.AfterClientRetrieval;

         WebGenType = prefs.Get<WebDeploymentType>(Preference.WebDeploymentType);
         WebRoot = prefs.Get<string>(Preference.WebDeploymentRoot);
         WebGenServer = prefs.Get<string>(Preference.WebGenServer);
         WebGenPort = prefs.Get<int>(Preference.WebGenPort);
         WebGenUsername = prefs.Get<string>(Preference.WebGenUsername);
         WebGenPassword = prefs.Get<string>(Preference.WebGenPassword);
         CopyHtml = prefs.Get<bool>(Preference.WebGenCopyHtml);
         CopyXml = prefs.Get<bool>(Preference.WebGenCopyXml);
         CopyFAHlog = prefs.Get<bool>(Preference.WebGenCopyFAHlog);
         FtpMode = prefs.Get<FtpMode>(Preference.WebGenFtpMode);
         LimitLogSize = prefs.Get<bool>(Preference.WebGenLimitLogSize);
         LimitLogSizeLength = prefs.Get<int>(Preference.WebGenLimitLogSizeLength);
      }
Exemplo n.º 2
0
 public PluginLoader(IPreferenceSet prefs, IFileSerializerPluginManager<List<DataTypes.Protein>> proteinPluginManager,
     IFileSerializerPluginManager<List<DataTypes.ProteinBenchmark>> benchmarkPluginManager,
     IFileSerializerPluginManager<List<DataTypes.ClientSettings>> clientSettingsPluginManager)
 {
     _prefs = prefs;
      _proteinPluginManager = proteinPluginManager;
      _benchmarkPluginManager = benchmarkPluginManager;
      _clientSettingsPluginManager = clientSettingsPluginManager;
 }
Exemplo n.º 3
0
 public void Update(IPreferenceSet prefs)
 {
    prefs.Set(Preference.CssFile, CssFile);
    prefs.Set(Preference.WebOverview, WebOverview);
    prefs.Set(Preference.WebMobileOverview, WebMobileOverview);
    prefs.Set(Preference.WebSummary, WebSummary);
    prefs.Set(Preference.WebMobileSummary, WebMobileSummary);
    prefs.Set(Preference.WebSlot, WebSlot);
 }
Exemplo n.º 4
0
        public MessagesForm(IPreferenceSet prefs, ILogger logger)
        {
            _prefs = prefs;
             _logger = (Logger)logger;

             InitializeComponent();

             _logger.TextMessage += (sender, e) => AddMessage(e.Messages);
        }
Exemplo n.º 5
0
 public void Load(IPreferenceSet prefs)
 {
    ApplicationPath = prefs.ApplicationPath;
    CssFile = prefs.Get<string>(Preference.CssFile);
    WebOverview = prefs.Get<string>(Preference.WebOverview);
    WebMobileOverview = prefs.Get<string>(Preference.WebMobileOverview);
    WebSummary = prefs.Get<string>(Preference.WebSummary);
    WebMobileSummary = prefs.Get<string>(Preference.WebMobileSummary);
    WebSlot = prefs.Get<string>(Preference.WebSlot);
 }
Exemplo n.º 6
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.º 7
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.º 8
0
 public void Load(IPreferenceSet prefs)
 {
    ServerSecure = prefs.Get<bool>(Preference.EmailReportingServerSecure);
    ToAddress = prefs.Get<string>(Preference.EmailReportingToAddress);
    FromAddress = prefs.Get<string>(Preference.EmailReportingFromAddress);
    ServerAddress = prefs.Get<string>(Preference.EmailReportingServerAddress);
    ServerPort = prefs.Get<int>(Preference.EmailReportingServerPort);
    ServerUsername = prefs.Get<string>(Preference.EmailReportingServerUsername);
    ServerPassword = prefs.Get<string>(Preference.EmailReportingServerPassword);
    ReportingEnabled = prefs.Get<bool>(Preference.EmailReportingEnabled);
    ReportEuePause = prefs.Get<bool>(Preference.ReportEuePause);
    ReportHung = prefs.Get<bool>(Preference.ReportHung);
 }
Exemplo n.º 9
0
 public void Update(IPreferenceSet prefs)
 {
    prefs.Set(Preference.EmailReportingServerSecure, ServerSecure);
    prefs.Set(Preference.EmailReportingToAddress, ToAddress);
    prefs.Set(Preference.EmailReportingFromAddress, FromAddress);
    prefs.Set(Preference.EmailReportingServerAddress, ServerAddress);
    prefs.Set(Preference.EmailReportingServerPort, ServerPort);
    prefs.Set(Preference.EmailReportingServerUsername, ServerUsername);
    prefs.Set(Preference.EmailReportingServerPassword, ServerPassword);
    prefs.Set(Preference.EmailReportingEnabled, ReportingEnabled);
    prefs.Set(Preference.ReportEuePause, ReportEuePause);
    prefs.Set(Preference.ReportHung, ReportHung);
 }
Exemplo n.º 10
0
 public void Load(IPreferenceSet prefs)
 {
    EocUserId = prefs.Get<int>(Preference.EocUserId);
    StanfordId = prefs.Get<string>(Preference.StanfordId);
    TeamId = prefs.Get<int>(Preference.TeamId);
    ProjectDownloadUrl = prefs.Get<string>(Preference.ProjectDownloadUrl);
    ProxyServer = prefs.Get<string>(Preference.ProxyServer);
    ProxyPort = prefs.Get<int>(Preference.ProxyPort);
    UseProxy = prefs.Get<bool>(Preference.UseProxy);
    ProxyUser = prefs.Get<string>(Preference.ProxyUser);
    ProxyPass = prefs.Get<string>(Preference.ProxyPass);
    UseProxyAuth = prefs.Get<bool>(Preference.UseProxyAuth);
 }
Exemplo n.º 11
0
 public void Update(IPreferenceSet prefs)
 {
    prefs.Set(Preference.EocUserId, EocUserId);
    prefs.Set(Preference.StanfordId, StanfordId);
    prefs.Set(Preference.TeamId, TeamId);
    prefs.Set(Preference.ProjectDownloadUrl, ProjectDownloadUrl);
    prefs.Set(Preference.ProxyServer, ProxyServer);
    prefs.Set(Preference.ProxyPort, ProxyPort);
    prefs.Set(Preference.UseProxy, UseProxy);
    prefs.Set(Preference.ProxyUser, ProxyUser);
    prefs.Set(Preference.ProxyPass, ProxyPass);
    prefs.Set(Preference.UseProxyAuth, UseProxyAuth);
 }
Exemplo n.º 12
0
 public void Load(IPreferenceSet prefs)
 {
    OfflineLast = prefs.Get<bool>(Preference.OfflineLast);
    ColorLogFile = prefs.Get<bool>(Preference.ColorLogFile);
    AutoSaveConfig = prefs.Get<bool>(Preference.AutoSaveConfig);
    PpdCalculation = prefs.Get<PpdCalculationType>(Preference.PpdCalculation);
    DecimalPlaces = prefs.Get<int>(Preference.DecimalPlaces);
    CalculateBonus = prefs.Get<BonusCalculationType>(Preference.BonusCalculation);
    EtaDate = prefs.Get<bool>(Preference.DisplayEtaAsDate);
    DuplicateProjectCheck = prefs.Get<bool>(Preference.DuplicateProjectCheck);
    DuplicateUserIdCheck = prefs.Get<bool>(Preference.DuplicateUserIdCheck);
    ShowXmlStats = prefs.Get<bool>(Preference.EnableUserStats);
    MessageLevel = (LoggerLevel)prefs.Get<int>(Preference.MessageLevel);
    FormShowStyle = prefs.Get<MinimizeToOption>(Preference.MinimizeTo);
 }
Exemplo n.º 13
0
 public void Update(IPreferenceSet prefs)
 {
    prefs.Set(Preference.OfflineLast, OfflineLast);
    prefs.Set(Preference.ColorLogFile, ColorLogFile);
    prefs.Set(Preference.AutoSaveConfig, AutoSaveConfig);
    prefs.Set(Preference.PpdCalculation, PpdCalculation);
    prefs.Set(Preference.DecimalPlaces, DecimalPlaces);
    prefs.Set(Preference.BonusCalculation, CalculateBonus);
    prefs.Set(Preference.DisplayEtaAsDate, EtaDate);
    prefs.Set(Preference.DuplicateProjectCheck, DuplicateProjectCheck);
    prefs.Set(Preference.DuplicateUserIdCheck, DuplicateUserIdCheck);
    prefs.Set(Preference.EnableUserStats, ShowXmlStats);
    prefs.Set(Preference.MessageLevel, (int)MessageLevel);
    prefs.Set(Preference.MinimizeTo, FormShowStyle);
 }
Exemplo n.º 14
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(); };
        }
Exemplo n.º 15
0
      public HistoryForm(IPreferenceSet prefs)
      {
         InitializeComponent();

         // split container does not scale when
         // there is a fixed panel
         using (var myGraphics = CreateGraphics())
         {
            var dpi = myGraphics.DpiX;
            var scaleFactor = dpi / 96;
            var distance = splitContainerWrapper1.SplitterDistance * scaleFactor;
            splitContainerWrapper1.SplitterDistance = (int)distance;
         }

         SetupDataGridView(prefs);
      }
Exemplo n.º 16
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.º 17
0
 public RetrievalLogic(IPreferenceSet prefs, IClientDictionary clientDictionary, MainGridModel mainGridModel)
 {
     _prefs = prefs;
      _clientDictionary = clientDictionary;
      _clientDictionary.DictionaryChanged += delegate { SetTimerState(); };
      _clientDictionary.ClientDataDirty += (sender, e) =>
                                             {
                                                if (e.Name == null)
                                                {
                                                   QueueNewRetrieval();
                                                }
                                                else
                                                {
                                                   RetrieveSingleClient(e.Name);
                                                }
                                             };
      _mainGridModel = mainGridModel;
 }
Exemplo n.º 18
0
        public Logger(IPreferenceSet prefs)
            : base("Default")
        {
            _prefs = prefs;

             try
             {
            Initialize();
             }
             catch (IOException ex)
             {
            string message = String.Format(CultureInfo.CurrentCulture,
               "Logging failed to initialize.  Please check to be sure that the {0} or {1} file is not open or otherwise in use.",
               Constants.HfmLogFileName, Constants.HfmPrevLogFileName);
            throw new IOException(message, ex);
             }
             Level = GetLoggerLevel();
        }
Exemplo n.º 19
0
      public UserStatsDataModel(IPreferenceSet prefs, IXmlStatsDataContainer dataContainer)
      {
         _updateTimer = new System.Timers.Timer();
         _updateTimer.Elapsed += UpdateTimerElapsed;

         _prefs = prefs;
         _prefs.PreferenceChanged += (s, e) =>
                                     {
                                        if (e.Preference == Preference.EnableUserStats)
                                        {
                                           ControlsVisible = _prefs.Get<bool>(Preference.EnableUserStats);
                                           if (ControlsVisible)
                                           {
                                              _dataContainer.GetEocXmlData(false);
                                              StartTimer();
                                           }
                                           else
                                           {
                                              StopTimer();
                                           }
                                        }
                                     };
         _dataContainer = dataContainer;
         _dataContainer.XmlStatsDataChanged += delegate
                                               {
                                                  AutoMapper.Mapper.Map(_dataContainer.XmlStatsData, this);
                                                  OnPropertyChanged(null);
                                               };

         // apply data container to the model
         ControlsVisible = _prefs.Get<bool>(Preference.EnableUserStats);
         if (ControlsVisible)
         {
            DateTime nextUpdateTime = _dataContainer.GetNextUpdateTime();
            if (nextUpdateTime < DateTime.UtcNow)
            {
               _dataContainer.GetEocXmlData(false);
            }
            StartTimer();
         }
         AutoMapper.Mapper.Map(_dataContainer.XmlStatsData, this);
      }
Exemplo n.º 20
0
      public void Update(IPreferenceSet prefs)
      {
         var clientRetrievalTask = new ClientRetrievalTask
         {
            Enabled = SyncOnSchedule,
            Interval = SyncTimeMinutes,
            ProcessingMode = SyncOnLoad ? ProcessingMode.Serial : ProcessingMode.Parallel
         };
         prefs.Set(Preference.ClientRetrievalTask, clientRetrievalTask);
         prefs.Set(Preference.AllowRunningAsync, AllowRunningAsync);

         var webGenerationTask = new WebGenerationTask
         {
            Enabled = GenerateWeb,
            Interval = GenerateInterval,
            AfterClientRetrieval = WebGenAfterRefresh
         };
         prefs.Set(Preference.WebGenerationTask, webGenerationTask);

         prefs.Set(Preference.WebDeploymentType, WebGenType);
         if (WebGenType == WebDeploymentType.Ftp)
         {
            prefs.Set(Preference.WebDeploymentRoot, Paths.AddUnixTrailingSlash(WebRoot));
         }
         else
         {
            prefs.Set(Preference.WebDeploymentRoot, Paths.AddTrailingSlash(WebRoot));
         }
         prefs.Set(Preference.WebGenServer, WebGenServer);
         prefs.Set(Preference.WebGenPort, WebGenPort);
         prefs.Set(Preference.WebGenUsername, WebGenUsername);
         prefs.Set(Preference.WebGenPassword, WebGenPassword);
         prefs.Set(Preference.WebGenCopyHtml, CopyHtml);
         prefs.Set(Preference.WebGenCopyXml, CopyXml);
         prefs.Set(Preference.WebGenCopyFAHlog, CopyFAHlog);
         prefs.Set(Preference.WebGenFtpMode, FtpMode);
         prefs.Set(Preference.WebGenLimitLogSize, LimitLogSize);
         prefs.Set(Preference.WebGenLimitLogSizeLength, LimitLogSizeLength);
      }
Exemplo n.º 21
0
      public void Init()
      {
         _prefs = MockRepository.GenerateStub<IPreferenceSet>();
         _prefs.Stub(x => x.Get<PpdCalculationType>(Preference.PpdCalculation)).Return(PpdCalculationType.LastThreeFrames);
         _prefs.Stub(x => x.Get<BonusCalculationType>(Preference.CalculateBonus)).Return(BonusCalculationType.DownloadTime);
         _prefs.Stub(x => x.Get<bool>(Preference.ShowVersions)).Return(true);
         _prefs.Stub(x => x.Get<int>(Preference.DecimalPlaces)).Return(1);
         _prefs.Stub(x => x.Get<CompletedCountDisplayType>(Preference.CompletedCountDisplay)).Return(CompletedCountDisplayType.ClientRunTotal);
         _prefs.Stub(x => x.Get<bool>(Preference.EtaDate)).Return(false);
         _prefs.Stub(x => x.Get<string>(Preference.StanfordId)).Return("harlam357");
         _prefs.Stub(x => x.Get<int>(Preference.EtaDate)).Return(32);

         var container = new WindsorContainer();
         container.Register(
            Component.For<UnitInfoLogic>()
               .LifeStyle.Transient);
         ServiceLocator.SetContainer(container);
         container.Register(
            Component.For<IProteinBenchmarkCollection>()
               .ImplementedBy<ProteinBenchmarkCollection>());
         Core.Configuration.ObjectMapper.CreateMaps();
      }
Exemplo n.º 22
0
        public PreferencesDialog(IPreferenceSet prefs, IAutoRun autoRun)
        {
            _prefs = prefs;
             _autoRun = autoRun;

             InitializeComponent();

             udDecimalPlaces.Minimum = 0;
             udDecimalPlaces.Maximum = Constants.MaxDecimalPlaces;

             _validatingControls = new List<IValidatingControl>[tabControl1.TabCount];
             _propertyCollection = new PropertyDescriptorCollection[tabControl1.TabCount];
             _models = new object[tabControl1.TabCount];
             if (!Core.Application.IsRunningOnMono)
             {
            _cssSampleBrowser = new WebBrowser();

            pnl1CSSSample.Controls.Add(_cssSampleBrowser);

            _cssSampleBrowser.Dock = DockStyle.Fill;
            _cssSampleBrowser.Location = new Point(0, 0);
            _cssSampleBrowser.MinimumSize = new Size(20, 20);
            _cssSampleBrowser.Name = "_cssSampleBrowser";
            _cssSampleBrowser.Size = new Size(354, 208);
            _cssSampleBrowser.TabIndex = 0;
            _cssSampleBrowser.TabStop = false;
             }

             txtCollectMinutes.ErrorToolTipText = String.Format("Minutes must be a value from {0} to {1}.", Constants.MinMinutes, Constants.MaxMinutes);
             txtWebGenMinutes.ErrorToolTipText = String.Format("Minutes must be a value from {0} to {1}.", Constants.MinMinutes, Constants.MaxMinutes);

             _scheduledTasksModel = new ScheduledTasksModel(prefs);
             _startupAndExternalModel = new StartupAndExternalModel(prefs);
             _optionsModel = new OptionsModel(prefs);
             _reportingModel = new ReportingModel(prefs);
             _webSettingsModel = new WebSettingsModel(prefs);
             _webVisualStylesModel = new WebVisualStylesModel(prefs);
        }
Exemplo n.º 23
0
      public void Load(IPreferenceSet prefs, IQueryParametersCollection queryCollection)
      {
         _bonusCalculation = prefs.Get<BonusCalculationType>(Preference.HistoryBonusCalculation);
         _showEntriesValue = prefs.Get<int>(Preference.ShowEntriesValue);
         FormLocation = prefs.Get<Point>(Preference.HistoryFormLocation);
         FormSize = prefs.Get<Size>(Preference.HistoryFormSize);
         SortColumnName = prefs.Get<string>(Preference.HistorySortColumnName);
         SortOrder = prefs.Get<ListSortDirection>(Preference.HistorySortOrder);
         FormColumns = prefs.Get<ICollection<string>>(Preference.HistoryFormColumns);

         _queryList.Clear();
         _queryList.Add(new QueryParameters());
         foreach (var query in queryCollection)
         {
            // don't load Select All twice
            if (query.Name != QueryParameters.SelectAll.Name)
            {
               _queryList.Add(query);
            }
         }
         _queryList.Sort();
         ResetBindings(true);
      }
Exemplo n.º 24
0
 public WebSettingsModel(IPreferenceSet prefs)
 {
    Load(prefs);
 }
Exemplo n.º 25
0
      public void Update(IPreferenceSet prefs, IQueryParametersCollection queryCollection)
      {
         prefs.Set(Preference.HistoryBonusCalculation, _bonusCalculation);
         prefs.Set(Preference.ShowEntriesValue, _showEntriesValue);
         prefs.Set(Preference.HistoryFormLocation, FormLocation);
         prefs.Set(Preference.HistoryFormSize, FormSize);
         prefs.Set(Preference.HistorySortColumnName, SortColumnName);
         prefs.Set(Preference.HistorySortOrder, SortOrder);
         prefs.Set(Preference.HistoryFormColumns, FormColumns);
         prefs.Save();

         queryCollection.Clear();
         foreach (var query in _queryList)
         {
            // don't save Select All to disk
            if (query.Name != QueryParameters.SelectAll.Name)
            {
               queryCollection.Add(query);
            }
         }
         queryCollection.Write();
      }
Exemplo n.º 26
0
 public OptionsModel(IPreferenceSet prefs)
 {
     Load(prefs);
 }
Exemplo n.º 27
0
 public ExternalProcessStarter(IPreferenceSet prefs, ILogger logger)
 {
    _prefs = prefs;
    _logger = logger;
 }
        /// <summary>
        /// Reads the settings from the specified preference set.
        /// </summary>
        /// <param name="preferenceSet">The preference set which contains the data to read.</param>
        /// <returns>The resulting report settings.</returns>
        public static HtmlReportSplitSettings ReadFrom(IPreferenceSet preferenceSet)
        {
            if (preferenceSet == null)
                throw new ArgumentNullException("preferenceSet");

            return new HtmlReportSplitSettings
            {
                Enabled = preferenceSet.Read(reader => reader.GetSetting(new Key<bool>("HtmlReportSplitEnabled"), DefaultEnabled)),
                PageSize = preferenceSet.Read(reader => reader.GetSetting(new Key<int>("HtmlReportSplitPageSize"), DefaultPageSize)),
            };
        }
 public WebVisualStylesModel(IPreferenceSet prefs)
 {
     Load(prefs);
 }
Exemplo n.º 30
0
        public RetrievalModel(IPreferenceSet prefs, IClientConfiguration clientConfiguration,
                              Lazy <IMarkupGenerator> markupGenerator, Lazy <IWebsiteDeployer> websiteDeployer)
        {
            _prefs = prefs;
            _clientConfiguration  = clientConfiguration;
            _markupGenerator      = markupGenerator;
            _websiteDeployer      = websiteDeployer;
            _taskManager          = new TaskManager();
            _taskManager.Changed += (s, e) => ReportAction(e);

            _prefs.PreferenceChanged += (s, e) =>
            {
                switch (e.Preference)
                {
                case Preference.ClientRetrievalTask:
                    if (_prefs.Get <bool>(Preference.ClientRetrievalTaskEnabled))
                    {
                        if (_clientConfiguration.Count != 0)
                        {
                            _taskManager.Restart(ClientTaskKey, ClientInterval);
                        }
                    }
                    else
                    {
                        _taskManager.Stop(ClientTaskKey);
                    }
                    break;

                case Preference.WebGenerationTask:
                    if (_prefs.Get <bool>(Preference.WebGenerationTaskEnabled) &&
                        _prefs.Get <bool>(Preference.WebGenerationTaskAfterClientRetrieval) == false)
                    {
                        if (_clientConfiguration.Count != 0)
                        {
                            _taskManager.Restart(WebTaskKey, WebInterval);
                        }
                    }
                    else
                    {
                        _taskManager.Stop(WebTaskKey);
                    }
                    break;
                }
            };

            _clientConfiguration.DictionaryChanged += (s, e) =>
            {
                if (e.ChangedType == ConfigurationChangedType.Remove ||
                    e.ChangedType == ConfigurationChangedType.Clear)
                {
                    // Disable timers if no hosts
                    if (_taskManager.Enabled && _clientConfiguration.Count == 0)
                    {
                        Logger.Info("No clients... stopping all scheduled tasks");
                        //_taskManager.Stop();
                        _taskManager.Cancel();
                    }
                }
                else if (e.ChangedType == ConfigurationChangedType.Add)
                {
                    var clientTaskEnabled = _prefs.Get <bool>(Preference.ClientRetrievalTaskEnabled);
                    if (e.Client == null)
                    {
                        // no client specified - retrieve all
                        _taskManager.Run(ClientTaskKey, ClientInterval, clientTaskEnabled);
                    }
                    else if (clientTaskEnabled)
                    {
                        _taskManager.Start(ClientTaskKey, ClientInterval);
                    }

                    if (_prefs.Get <bool>(Preference.WebGenerationTaskEnabled) &&
                        _prefs.Get <bool>(Preference.WebGenerationTaskAfterClientRetrieval) == false)
                    {
                        _taskManager.Start(WebTaskKey, WebInterval);
                    }
                }
            };

            _taskManager.Add(ClientTaskKey, ClientRetrievalAction, ClientInterval);
            _taskManager.Add(WebTaskKey, WebGenerationAction, WebInterval);
        }
 public ScheduledTasksModel(IPreferenceSet prefs)
 {
     Load(prefs);
 }
Exemplo n.º 32
0
 public WebsiteDeployer(IPreferenceSet prefs, INetworkOps networkOps)
 {
     _prefs      = prefs;
     _networkOps = networkOps;
 }
Exemplo n.º 33
0
 public ReportingModel(IPreferenceSet prefs)
 {
     Load(prefs);
 }
Exemplo n.º 34
0
 public OptionsModel(IPreferenceSet prefs)
 {
     Load(prefs);
 }
Exemplo n.º 35
0
 public UpdateLogic(IPreferenceSet prefs, IMessageBoxView messageBoxView)
 {
     _prefs          = prefs;
     _messageBoxView = messageBoxView;
 }
        /// <summary>
        /// Writes the contents of the settings to the specified preference set.
        /// </summary>
        /// <param name="preferenceSet">The preference set to write data in.</param>
        public void WriteTo(IPreferenceSet preferenceSet)
        {
            if (preferenceSet == null)
                throw new ArgumentNullException("preferenceSet");

            preferenceSet.Write(writer => writer.SetSetting(new Key<bool>("HtmlReportSplitEnabled"), Enabled));
            preferenceSet.Write(writer => writer.SetSetting(new Key<int>("HtmlReportSplitPageSize"), pageSize));
        }
 public StartupAndExternalModel(IPreferenceSet prefs)
 {
     Load(prefs);
 }
Exemplo n.º 38
0
 public ExternalProcessStarter(IPreferenceSet prefs, ILogger logger)
 {
     _prefs  = prefs;
     _logger = logger;
 }
Exemplo n.º 39
0
 public WebVisualStylesModel(IPreferenceSet prefs)
 {
    Load(prefs);
 }
Exemplo n.º 40
0
 public UnitInfoDatabase(IPreferenceSet prefs, IProteinService proteinService)
     : this(prefs, proteinService, null)
 {
 }
Exemplo n.º 41
0
 public WebSettingsModel(IPreferenceSet prefs)
 {
     Load(prefs);
 }
Exemplo n.º 42
0
        private void SetupDataGridView(IPreferenceSet prefs)
        {
            // Add Column Selector
            new DataGridViewColumnSelector(dataGridView1);

            string[] names = QueryField.GetColumnNames();

            dataGridView1.AutoGenerateColumns = false;
            // ReSharper disable PossibleNullReferenceException
            dataGridView1.Columns.Add(QueryFieldName.ProjectID.ToString(), names[(int)QueryFieldName.ProjectID]);
            dataGridView1.Columns[QueryFieldName.ProjectID.ToString()].DataPropertyName = QueryFieldName.ProjectID.ToString();
            dataGridView1.Columns.Add(QueryFieldName.WorkUnitName.ToString(), names[(int)QueryFieldName.WorkUnitName]);
            dataGridView1.Columns[QueryFieldName.WorkUnitName.ToString()].DataPropertyName = QueryFieldName.WorkUnitName.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Name.ToString(), names[(int)QueryFieldName.Name]);
            dataGridView1.Columns[QueryFieldName.Name.ToString()].DataPropertyName = QueryFieldName.Name.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Path.ToString(), names[(int)QueryFieldName.Path]);
            dataGridView1.Columns[QueryFieldName.Path.ToString()].DataPropertyName = QueryFieldName.Path.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Username.ToString(), names[(int)QueryFieldName.Username]);
            dataGridView1.Columns[QueryFieldName.Username.ToString()].DataPropertyName = QueryFieldName.Username.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Team.ToString(), names[(int)QueryFieldName.Team]);
            dataGridView1.Columns[QueryFieldName.Team.ToString()].DataPropertyName = QueryFieldName.Team.ToString();
            dataGridView1.Columns.Add(QueryFieldName.SlotType.ToString(), names[(int)QueryFieldName.SlotType]);
            dataGridView1.Columns[QueryFieldName.SlotType.ToString()].DataPropertyName = QueryFieldName.SlotType.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Core.ToString(), names[(int)QueryFieldName.Core]);
            dataGridView1.Columns[QueryFieldName.Core.ToString()].DataPropertyName = QueryFieldName.Core.ToString();
            dataGridView1.Columns.Add(QueryFieldName.CoreVersion.ToString(), names[(int)QueryFieldName.CoreVersion]);
            dataGridView1.Columns[QueryFieldName.CoreVersion.ToString()].DataPropertyName = QueryFieldName.CoreVersion.ToString();
            dataGridView1.Columns.Add(QueryFieldName.FrameTime.ToString(), names[(int)QueryFieldName.FrameTime]);
            dataGridView1.Columns[QueryFieldName.FrameTime.ToString()].DataPropertyName = QueryFieldName.FrameTime.ToString();
            dataGridView1.Columns.Add(QueryFieldName.KFactor.ToString(), names[(int)QueryFieldName.KFactor]);
            dataGridView1.Columns[QueryFieldName.KFactor.ToString()].DataPropertyName = QueryFieldName.KFactor.ToString();
            dataGridView1.Columns.Add(QueryFieldName.PPD.ToString(), names[(int)QueryFieldName.PPD]);
            dataGridView1.Columns[QueryFieldName.PPD.ToString()].DataPropertyName = QueryFieldName.PPD.ToString();
            dataGridView1.Columns[QueryFieldName.PPD.ToString()].DefaultCellStyle = new DataGridViewCellStyle {
                Format = prefs.GetPpdFormatString()
            };
            dataGridView1.Columns.Add(QueryFieldName.DownloadDateTime.ToString(), names[(int)QueryFieldName.DownloadDateTime]);
            dataGridView1.Columns[QueryFieldName.DownloadDateTime.ToString()].DataPropertyName = QueryFieldName.DownloadDateTime.ToString();
            dataGridView1.Columns.Add(QueryFieldName.CompletionDateTime.ToString(), names[(int)QueryFieldName.CompletionDateTime]);
            dataGridView1.Columns[QueryFieldName.CompletionDateTime.ToString()].DataPropertyName = QueryFieldName.CompletionDateTime.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Credit.ToString(), names[(int)QueryFieldName.Credit]);
            dataGridView1.Columns[QueryFieldName.Credit.ToString()].DataPropertyName = QueryFieldName.Credit.ToString();
            dataGridView1.Columns[QueryFieldName.Credit.ToString()].DefaultCellStyle = new DataGridViewCellStyle {
                Format = prefs.GetPpdFormatString()
            };
            dataGridView1.Columns.Add(QueryFieldName.Frames.ToString(), names[(int)QueryFieldName.Frames]);
            dataGridView1.Columns[QueryFieldName.Frames.ToString()].DataPropertyName = QueryFieldName.Frames.ToString();
            dataGridView1.Columns.Add(QueryFieldName.FramesCompleted.ToString(), names[(int)QueryFieldName.FramesCompleted]);
            dataGridView1.Columns[QueryFieldName.FramesCompleted.ToString()].DataPropertyName = QueryFieldName.FramesCompleted.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Result.ToString(), names[(int)QueryFieldName.Result]);
            dataGridView1.Columns[QueryFieldName.Result.ToString()].DataPropertyName = QueryFieldName.Result.ToString();
            dataGridView1.Columns.Add(QueryFieldName.Atoms.ToString(), names[(int)QueryFieldName.Atoms]);
            dataGridView1.Columns[QueryFieldName.Atoms.ToString()].DataPropertyName = QueryFieldName.Atoms.ToString();
            dataGridView1.Columns.Add(QueryFieldName.ProjectRun.ToString(), names[(int)QueryFieldName.ProjectRun]);
            dataGridView1.Columns[QueryFieldName.ProjectRun.ToString()].DataPropertyName = QueryFieldName.ProjectRun.ToString();
            dataGridView1.Columns.Add(QueryFieldName.ProjectClone.ToString(), names[(int)QueryFieldName.ProjectClone]);
            dataGridView1.Columns[QueryFieldName.ProjectClone.ToString()].DataPropertyName = QueryFieldName.ProjectClone.ToString();
            dataGridView1.Columns.Add(QueryFieldName.ProjectGen.ToString(), names[(int)QueryFieldName.ProjectGen]);
            dataGridView1.Columns[QueryFieldName.ProjectGen.ToString()].DataPropertyName = QueryFieldName.ProjectGen.ToString();
            // ReSharper restore PossibleNullReferenceException
        }