コード例 #1
0
        private static void ValidatePreferences(IPreferenceSet prefs)
        {
            // MessageLevel
            int level = prefs.Get <int>(Preference.MessageLevel);

            if (level < 4)
            {
                level = 4;
            }
            else if (level > 5)
            {
                level = 5;
            }
            prefs.Set(Preference.MessageLevel, level);

            const int defaultInterval = 15;
            // ClientRetrievalTask.Interval
            var clientRetrievalTask = prefs.Get <Preferences.Data.ClientRetrievalTask>(Preference.ClientRetrievalTask);

            if (!Validate.Minutes(clientRetrievalTask.Interval))
            {
                clientRetrievalTask.Interval = defaultInterval;
                prefs.Set(Preference.ClientRetrievalTask, clientRetrievalTask);
            }
            // WebGenerationTask.Interval
            var webGenerationTask = prefs.Get <Preferences.Data.WebGenerationTask>(Preference.WebGenerationTask);

            if (!Validate.Minutes(webGenerationTask.Interval))
            {
                webGenerationTask.Interval = defaultInterval;
                prefs.Set(Preference.WebGenerationTask, webGenerationTask);
            }
        }
コード例 #2
0
 private void frmBenchmarks_FormClosing(object sender, FormClosingEventArgs e)
 {
     // Save state data
     _prefs.Set(Preference.BenchmarksFormLocation, Location);
     _prefs.Set(Preference.BenchmarksFormSize, Size);
     _prefs.Set(Preference.BenchmarksGraphLayoutType, GraphLayoutType);
     _prefs.Save();
 }
コード例 #3
0
ファイル: ReportingModel.cs プロジェクト: harlam357/hfm-net
 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);
 }
コード例 #4
0
ファイル: WebSettingsModel.cs プロジェクト: harlam357/hfm-net
 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);
 }
コード例 #5
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);
 }
コード例 #6
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);
 }
コード例 #7
0
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            // Save state data
            if (WindowState == FormWindowState.Normal)
            {
                _prefs.Set(Preference.MessagesFormLocation, Location);
                _prefs.Set(Preference.MessagesFormSize, Size);
                _prefs.Save();
            }

            Hide();
            e.Cancel = true;
            base.OnClosing(e);
        }
コード例 #8
0
        public MainGridModel(IPreferenceSet prefs, ISynchronizeInvoke syncObject, IClientConfiguration clientConfiguration)
        {
            _prefs                       = prefs;
            _syncObject                  = syncObject;
            _clientConfiguration         = clientConfiguration;
            _slotList                    = new SlotModelSortableBindingList(_syncObject);
            _slotList.OfflineClientsLast = _prefs.Get <bool>(Preference.OfflineLast);
            _slotList.Sorted            += (sender, e) =>
            {
                SortColumnName = e.Name;
                _prefs.Set(Preference.FormSortColumn, SortColumnName);
                SortColumnOrder = e.Direction;
                _prefs.Set(Preference.FormSortOrder, SortColumnOrder);
            };
            _bindingSource                     = new BindingSource();
            _bindingSource.DataSource          = _slotList;
            _bindingSource.CurrentItemChanged += (sender, args) => SelectedSlot = (SlotModel)_bindingSource.Current;
#if DEBUG
            _slotList.ListChanged      += (s, e) => Debug.WriteLine("BindingList: " + e.ListChangedType);
            _bindingSource.ListChanged += (s, e) => Debug.WriteLine("BindingSource: " + e.ListChangedType);
#endif
            // Subscribe to PreferenceSet events
            _prefs.PreferenceChanged += (s, e) =>
            {
                switch (e.Preference)
                {
                case Preference.OfflineLast:
                    _slotList.OfflineClientsLast = _prefs.Get <bool>(Preference.OfflineLast);
                    Sort();
                    break;

                case Preference.PpdCalculation:
                case Preference.DecimalPlaces:
                case Preference.BonusCalculation:
                    ResetBindings();
                    break;
                }
            };

            // Subscribe to ClientDictionary events
            _clientConfiguration.DictionaryChanged += (sender, args) => ResetBindings();
        }
コード例 #9
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);
      }
コード例 #10
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);
 }
コード例 #11
0
 public void Update(IPreferenceSet prefs)
 {
     prefs.Set(Preference.RunMinimized, RunMinimized);
     prefs.Set(Preference.StartupCheckForUpdate, StartupCheckForUpdate);
     prefs.Set(Preference.DefaultConfigFile, DefaultConfigFile);
     prefs.Set(Preference.UseDefaultConfigFile, UseDefaultConfigFile);
     prefs.Set(Preference.LogFileViewer, LogFileViewer);
     prefs.Set(Preference.FileExplorer, FileExplorer);
 }
コード例 #12
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);
 }
コード例 #13
0
        public void Update(IPreferenceSet prefs, IQueryParametersContainer queryContainer)
        {
            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();

            queryContainer.Update(_queryList.Where(x => x.Name != QueryParameters.SelectAll.Name));
        }
コード例 #14
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, FileSystemPath.AddUnixTrailingSlash(WebRoot));
            }
            else
            {
                prefs.Set(Preference.WebDeploymentRoot, FileSystemPath.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);
        }
コード例 #15
0
ファイル: OptionsModel.cs プロジェクト: pnoodles/hfm-net
 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);
 }
コード例 #16
0
ファイル: MainGridModel.cs プロジェクト: harlam357/hfm-net
      public MainGridModel(IPreferenceSet prefs, ISynchronizeInvoke syncObject, IClientConfiguration clientConfiguration)
      {
         _prefs = prefs;
         _syncObject = syncObject;
         _clientConfiguration = clientConfiguration;
         _slotList = new SlotModelSortableBindingList(_syncObject);
         _slotList.OfflineClientsLast = _prefs.Get<bool>(Preference.OfflineLast);
         _slotList.Sorted += (sender, e) =>
                             {
                                SortColumnName = e.Name;
                                _prefs.Set(Preference.FormSortColumn, SortColumnName);
                                SortColumnOrder = e.Direction;
                                _prefs.Set(Preference.FormSortOrder, SortColumnOrder);
                             };
         _bindingSource = new BindingSource();
         _bindingSource.DataSource = _slotList;
         _bindingSource.CurrentItemChanged += (sender, args) => SelectedSlot = (SlotModel)_bindingSource.Current;
#if DEBUG
         _slotList.ListChanged += (s, e) => Debug.WriteLine("BindingList: " + e.ListChangedType);
         _bindingSource.ListChanged += (s, e) => Debug.WriteLine("BindingSource: " + e.ListChangedType);
#endif
         // Subscribe to PreferenceSet events
         _prefs.PreferenceChanged += (s, e) =>
                                     {
                                        switch (e.Preference)
                                        {
                                           case Preference.OfflineLast:
                                              _slotList.OfflineClientsLast = _prefs.Get<bool>(Preference.OfflineLast);
                                              Sort();
                                              break;
                                           case Preference.PpdCalculation:
                                           case Preference.DecimalPlaces:
                                           case Preference.BonusCalculation:
                                              ResetBindings();
                                              break;
                                        }

                                     };

         // Subscribe to ClientDictionary events
         _clientConfiguration.DictionaryChanged += (sender, args) => ResetBindings();
      }
コード例 #17
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();
      }
コード例 #18
0
 public void SetViewStyle(bool showTeamStats)
 {
     _prefs.Set(Preference.UserStatsType, showTeamStats ? StatsType.Team : StatsType.User);
     // all properties
     OnPropertyChanged(null);
 }
コード例 #19
0
ファイル: OptionsModel.cs プロジェクト: kszysiu/hfm-net
 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.CalculateBonus, CalculateBonus);
      prefs.Set(Preference.EtaDate, EtaDate);
      prefs.Set(Preference.DuplicateProjectCheck, DuplicateProjectCheck);
      prefs.Set(Preference.DuplicateUserIdCheck, DuplicateUserIdCheck);
      prefs.Set(Preference.ShowXmlStats, ShowXmlStats);
      prefs.Set(Preference.MessageLevel, (int)MessageLevel);
      prefs.Set(Preference.FormShowStyle, FormShowStyle);
 }
コード例 #20
0
ファイル: MainGridModel.cs プロジェクト: kszysiu/hfm-net
        public MainGridModel(IPreferenceSet prefs, ISynchronizeInvoke syncObject, IClientDictionary clientDictionary)
        {
            _prefs = prefs;
             _syncObject = syncObject;
             _clientDictionary = clientDictionary;
             _slotList = new SlotModelSortableBindingList(_syncObject);
             _slotList.OfflineClientsLast = _prefs.Get<bool>(Preference.OfflineLast);
             _slotList.Sorted += (sender, e) =>
                             {
                                SortColumnName = e.Name;
                                _prefs.Set(Preference.FormSortColumn, SortColumnName);
                                SortColumnOrder = e.Direction;
                                _prefs.Set(Preference.FormSortOrder, SortColumnOrder);
                             };
             _bindingSource = new BindingSource();
             _bindingSource.DataSource = _slotList;
             _bindingSource.CurrentItemChanged += delegate
                                              {
                                                 SelectedSlot = (SlotModel)_bindingSource.Current;
                                              };
            #if DEBUG
             _slotList.ListChanged += (s, e) =>
                                  {
                                     Debug.WriteLine("BindingList: " + e.ListChangedType);
                                  };
             _bindingSource.ListChanged += (s, e) =>
                                       {
                                          Debug.WriteLine("BindingSource: " + e.ListChangedType);
                                       };
            #endif
             // Subscribe to PreferenceSet events
             _prefs.OfflineLastChanged += delegate
                                      {
                                         _slotList.OfflineClientsLast = _prefs.Get<bool>(Preference.OfflineLast);
                                         Sort();
                                      };
             _prefs.PpdCalculationChanged += delegate { ResetBindings(); };
             _prefs.DecimalPlacesChanged += delegate { ResetBindings(); };
             _prefs.CalculateBonusChanged += delegate { ResetBindings(); };

             // Subscribe to ClientDictionary events
             _clientDictionary.DictionaryChanged += delegate { ResetBindings(); };
             _clientDictionary.ClientDataInvalidated += delegate { ResetBindings(); };
        }
コード例 #21
0
        public void Update(IPreferenceSet prefs)
        {
            prefs.Set(Preference.SyncTimeMinutes, SyncTimeMinutes);
             prefs.Set(Preference.SyncOnSchedule, SyncOnSchedule);
             prefs.Set(Preference.SyncOnLoad, SyncOnLoad);
             prefs.Set(Preference.AllowRunningAsync, AllowRunningAsync);

             prefs.Set(Preference.WebGenType, WebGenType);
             prefs.Set(Preference.GenerateInterval, GenerateInterval);
             prefs.Set(Preference.WebGenAfterRefresh, WebGenAfterRefresh);
             if (WebGenType.Equals(WebGenType.Ftp))
             {
            prefs.Set(Preference.WebRoot, Paths.AddUnixTrailingSlash(WebRoot));
             }
             else
             {
            prefs.Set(Preference.WebRoot, 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);
             prefs.Set(Preference.GenerateWeb, GenerateWeb);
        }
コード例 #22
0
        public void ViewShown()
        {
            // Add the Index Changed Handler here after everything is shown
            _view.DataGridView.ColumnDisplayIndexChanged += delegate { DataGridViewColumnDisplayIndexChanged(); };
            // Then run it once to ensure the last column is set to Fill
            DataGridViewColumnDisplayIndexChanged();
            // Add the Splitter Moved Handler here after everything is shown - Issue 8
            // When the log file window (Panel2) is visible, this event will fire.
            // Update the split location directly from the split panel control. - Issue 8
            _view.SplitContainer.SplitterMoved += delegate
            {
                _prefs.Set(Preference.FormSplitterLocation, _view.SplitContainer.SplitterDistance);
                _prefs.Save();
            };

            if (_prefs.Get <bool>(Preference.RunMinimized))
            {
                _view.WindowState = FormWindowState.Minimized;
            }

            Debug.Assert(Arguments != null);
            var openFile = Arguments.FirstOrDefault(x => x.Type.Equals(ArgumentType.OpenFile));

            if (openFile != null)
            {
                if (!String.IsNullOrEmpty(openFile.Data))
                {
                    LoadConfigFile(openFile.Data);
                }
            }
            else if (_prefs.Get <bool>(Preference.UseDefaultConfigFile))
            {
                var fileName = _prefs.Get <string>(Preference.DefaultConfigFile);
                if (!String.IsNullOrEmpty(fileName))
                {
                    LoadConfigFile(fileName);
                }
            }

            SetViewShowStyle();

            if (_prefs.Get <bool>(Preference.StartupCheckForUpdate))
            {
                _updateLogic.CheckForUpdate();
            }
        }