Exemplo n.º 1
0
        public void Reset()
        {
            var data = new PreferenceData {
                ApplicationVersion = ApplicationVersion
            };

            Write(data);
            _prefs = CreateDictionary(data);
        }
Exemplo n.º 2
0
        protected PreferencesProvider(string applicationPath, string applicationDataFolderPath, string applicationVersion)
        {
            ApplicationPath           = applicationPath;
            ApplicationDataFolderPath = applicationDataFolderPath;
            ApplicationVersion        = applicationVersion;

            var data = new PreferenceData {
                ApplicationVersion = ApplicationVersion
            };

            _prefs = CreateDictionary(data);
        }
        static void LoadPreferencesObject()
        {
            string preferencesPath = FileUtility.GetLocalDataDirectory() + k_PrefsAssetName;

            // First try loading at the local files directory
            s_Preferences = AssetDatabase.LoadAssetAtPath <PreferenceDictionary>(preferencesPath);

            // If that fails, search the project for a compatible preference object
            if (s_Preferences == null)
            {
                s_Preferences = FileUtility.FindAssetOfType <PreferenceDictionary>();
            }
        }
Exemplo n.º 4
0
        protected PreferenceSetBase(string applicationPath, string applicationDataFolderPath, string applicationVersion)
        {
            if (String.IsNullOrWhiteSpace(applicationPath))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(applicationPath));
            }
            if (String.IsNullOrWhiteSpace(applicationDataFolderPath))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(applicationDataFolderPath));
            }
            if (String.IsNullOrWhiteSpace(applicationVersion))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(applicationVersion));
            }
            ApplicationPath           = applicationPath;
            ApplicationDataFolderPath = applicationDataFolderPath;
            ApplicationVersion        = applicationVersion;

            var data = new PreferenceData {
                ApplicationVersion = ApplicationVersion
            };

            _prefs = CreateDictionary(data);
        }
 void OnEnable()
 {
     m_Preferences = target as PreferenceDictionary;
     m_Search      = new SearchField();
     m_SearchText  = "";
 }
Exemplo n.º 6
0
 public void Load(PreferenceData data)
 {
     Upgrade(data);
     _prefs = CreateDictionary(data);
 }
Exemplo n.º 7
0
        private PreferenceDictionary CreateDictionary(PreferenceData data)
        {
            var prefs = new PreferenceDictionary(data);

            prefs.AddReadOnly(Preference.ApplicationPath, p => ApplicationPath);
            prefs.AddReadOnly(Preference.ApplicationDataFolderPath, p => ApplicationDataFolderPath);
            prefs.AddReadOnly(Preference.ApplicationVersion, p => p.ApplicationVersion);
            prefs.AddReadOnly(Preference.CacheDirectory, p => Path.Combine(ApplicationDataFolderPath, p.ApplicationSettings.CacheFolder));

            prefs.Add(Preference.FormLocation, p => p.MainWindow.Location);
            prefs.Add(Preference.FormSize, p => p.MainWindow.Size);
            prefs.Add(Preference.FormColumns, p => p.MainWindowGrid.Columns);
            prefs.Add(Preference.FormSortColumn, p => p.MainWindowGrid.SortColumn);
            prefs.Add(Preference.FormSortOrder, p => p.MainWindowGrid.SortOrder);
            prefs.Add(Preference.FormSplitterLocation, p => p.MainWindowState.SplitterLocation);
            prefs.Add(Preference.FormLogWindowHeight, p => p.MainWindowState.LogWindowHeight);
            prefs.Add(Preference.FormLogWindowVisible, p => p.MainWindowState.LogWindowVisible);
            prefs.Add(Preference.QueueWindowVisible, p => p.MainWindowState.QueueWindowVisible);
            prefs.Add(Preference.TimeFormatting, p => p.MainWindowGridProperties.TimeFormatting);
            prefs.Add(Preference.UnitTotals, p => p.MainWindowGridProperties.UnitTotals);
            prefs.Add(Preference.DisplayVersions, p => p.MainWindowGridProperties.DisplayVersions);

            prefs.Add(Preference.MinimizeTo, p => p.MainWindowProperties.MinimizeTo);
            prefs.Add(Preference.EnableUserStats, p => p.MainWindowProperties.EnableStats);
            prefs.Add(Preference.UserStatsType, p => p.MainWindowProperties.StatsType);

            prefs.Add(Preference.BenchmarksFormLocation, p => p.BenchmarksWindow.Location);
            prefs.Add(Preference.BenchmarksFormSize, p => p.BenchmarksWindow.Size);
            prefs.Add(Preference.GraphColors, p => p.BenchmarksGraphing.GraphColors);
            prefs.Add(Preference.BenchmarksGraphLayoutType, p => p.BenchmarksGraphing.GraphLayout);
            prefs.Add(Preference.BenchmarksClientsPerGraph, p => p.BenchmarksGraphing.ClientsPerGraph);

            prefs.Add(Preference.MessagesFormLocation, p => p.MessagesWindow.Location);
            prefs.Add(Preference.MessagesFormSize, p => p.MessagesWindow.Size);

            prefs.Add(Preference.ClientRetrievalTask, p => p.ClientRetrievalTask);
            prefs.AddReadOnly(Preference.ClientRetrievalTaskEnabled, p => p.ClientRetrievalTask.Enabled);
            prefs.AddReadOnly(Preference.ClientRetrievalTaskInterval, p => p.ClientRetrievalTask.Interval);
            prefs.AddReadOnly(Preference.ClientRetrievalTaskType, p => p.ClientRetrievalTask.ProcessingMode);

            prefs.Add(Preference.DuplicateUserIdCheck, p => p.ApplicationSettings.DuplicateUserIdCheck);
            prefs.Add(Preference.DuplicateProjectCheck, p => p.ApplicationSettings.DuplicateProjectCheck);
            prefs.Add(Preference.AllowRunningAsync, p => p.ApplicationSettings.AllowRunningAsync);

            prefs.Add(Preference.WebGenerationTask, p => p.WebGenerationTask);
            prefs.AddReadOnly(Preference.WebGenerationTaskEnabled, p => p.WebGenerationTask.Enabled);
            prefs.AddReadOnly(Preference.WebGenerationTaskInterval, p => p.WebGenerationTask.Interval);
            prefs.AddReadOnly(Preference.WebGenerationTaskAfterClientRetrieval, p => p.WebGenerationTask.AfterClientRetrieval);
            prefs.Add(Preference.WebDeploymentType, p => p.WebDeployment.DeploymentType);
            prefs.Add(Preference.WebDeploymentRoot, p => p.WebDeployment.DeploymentRoot);
            prefs.Add(Preference.WebGenServer, p => p.WebDeployment.FtpServer.Address);
            prefs.Add(Preference.WebGenPort, p => p.WebDeployment.FtpServer.Port);
            prefs.Add(Preference.WebGenUsername, p => p.WebDeployment.FtpServer.Username);
            prefs.AddEncrypted(Preference.WebGenPassword, p => p.WebDeployment.FtpServer.Password);
            prefs.Add(Preference.WebGenCopyFAHlog, p => p.WebDeployment.CopyLog);
            prefs.Add(Preference.WebGenFtpMode, p => p.WebDeployment.FtpMode);
            prefs.Add(Preference.WebGenCopyHtml, p => p.WebDeployment.CopyHtml);
            prefs.Add(Preference.WebGenCopyXml, p => p.WebDeployment.CopyXml);
            prefs.Add(Preference.WebGenLimitLogSize, p => p.WebDeployment.LogSizeLimitEnabled);
            prefs.Add(Preference.WebGenLimitLogSizeLength, p => p.WebDeployment.LogSizeLimitedTo);
            prefs.Add(Preference.CssFile, p => p.WebRendering.StyleSheet);
            prefs.Add(Preference.WebOverview, p => p.WebRendering.OverviewTransform);
            prefs.Add(Preference.WebMobileOverview, p => p.WebRendering.MobileOverviewTransform);
            prefs.Add(Preference.WebSummary, p => p.WebRendering.SummaryTransform);
            prefs.Add(Preference.WebMobileSummary, p => p.WebRendering.MobileSummaryTransform);
            prefs.Add(Preference.WebSlot, p => p.WebRendering.SlotTransform);

            prefs.Add(Preference.RunMinimized, p => p.Startup.RunMinimized);
            prefs.Add(Preference.StartupCheckForUpdate, p => p.Startup.CheckForUpdate);
            prefs.Add(Preference.UseDefaultConfigFile, p => p.Startup.DefaultConfigFileEnabled);
            prefs.Add(Preference.DefaultConfigFile, p => p.Startup.DefaultConfigFilePath);

            prefs.Add(Preference.OfflineLast, p => p.MainWindowGridProperties.OfflineClientsLast);
            prefs.Add(Preference.ColorLogFile, p => p.LogWindowProperties.ApplyColor);
            prefs.Add(Preference.AutoSaveConfig, p => p.ApplicationSettings.AutoSaveConfig);
            prefs.Add(Preference.PpdCalculation, p => p.ApplicationSettings.PpdCalculation);
            prefs.Add(Preference.DecimalPlaces, p => p.ApplicationSettings.DecimalPlaces);
            prefs.Add(Preference.BonusCalculation, p => p.ApplicationSettings.BonusCalculation);
            prefs.Add(Preference.FollowLog, p => p.LogWindowProperties.FollowLog);
            prefs.Add(Preference.DisplayEtaAsDate, p => p.MainWindowGridProperties.DisplayEtaAsDate);
            prefs.Add(Preference.LogFileViewer, p => p.ApplicationSettings.LogFileViewer);
            prefs.Add(Preference.FileExplorer, p => p.ApplicationSettings.FileExplorer);
            prefs.Add(Preference.MessageLevel, p => p.ApplicationSettings.MessageLevel);

            prefs.Add(Preference.EmailReportingEnabled, p => p.Email.Enabled);
            prefs.Add(Preference.EmailReportingServerSecure, p => p.Email.SecureConnection);
            prefs.Add(Preference.EmailReportingToAddress, p => p.Email.ToAddress);
            prefs.Add(Preference.EmailReportingFromAddress, p => p.Email.FromAddress);
            prefs.Add(Preference.EmailReportingServerAddress, p => p.Email.SmtpServer.Address);
            prefs.Add(Preference.EmailReportingServerPort, p => p.Email.SmtpServer.Port);
            prefs.Add(Preference.EmailReportingServerUsername, p => p.Email.SmtpServer.Username);
            prefs.AddEncrypted(Preference.EmailReportingServerPassword, p => p.Email.SmtpServer.Password);
            prefs.Add(Preference.ReportEuePause, p => p.Reporting.EuePauseEnabled);
            prefs.Add(Preference.ReportHung, p => p.Reporting.ClientHungEnabled);

            prefs.Add(Preference.EocUserId, p => p.UserSettings.EocUserId);
            prefs.Add(Preference.StanfordId, p => p.UserSettings.StanfordId);
            prefs.Add(Preference.TeamId, p => p.UserSettings.TeamId);
            prefs.Add(Preference.ProjectDownloadUrl, p => p.ApplicationSettings.ProjectDownloadUrl);
            prefs.Add(Preference.UseProxy, p => p.WebProxy.Enabled);
            prefs.Add(Preference.ProxyServer, p => p.WebProxy.Server.Address);
            prefs.Add(Preference.ProxyPort, p => p.WebProxy.Server.Port);
            prefs.Add(Preference.UseProxyAuth, p => p.WebProxy.CredentialsEnabled);
            prefs.Add(Preference.ProxyUser, p => p.WebProxy.Server.Username);
            prefs.AddEncrypted(Preference.ProxyPass, p => p.WebProxy.Server.Password);

            prefs.Add(Preference.HistoryBonusCalculation, p => p.HistoryWindowProperties.BonusCalculation);
            prefs.Add(Preference.ShowEntriesValue, p => p.HistoryWindowProperties.MaximumResults);
            prefs.Add(Preference.HistorySortColumnName, p => p.HistoryWindowGrid.SortColumn);
            prefs.Add(Preference.HistorySortOrder, p => p.HistoryWindowGrid.SortOrder);
            prefs.Add(Preference.HistoryFormLocation, p => p.HistoryWindow.Location);
            prefs.Add(Preference.HistoryFormSize, p => p.HistoryWindow.Size);
            prefs.Add(Preference.HistoryFormColumns, p => p.HistoryWindowGrid.Columns);

            prefs.AddReadOnly(Preference.CacheFolder, p => p.ApplicationSettings.CacheFolder);

            return(prefs);
        }
Exemplo n.º 8
0
        public PreferenceSet()
        {
            var data = new PreferenceData();

            _prefs = CreateDictionary(data);
        }
Exemplo n.º 9
0
 private void InitializeInternal(PreferenceData data)
 {
     Upgrade(data);
     _prefs = CreateDictionary(data);
 }