Beispiel #1
0
        public ProgramSettings(IFileStorage fileStorage)
        {
            this._buferDefaultBackgroundColorSetting = new SettingItem <int>(
                Color.Silver.ToArgb(),
                User.Default.BuferDefaultBackgroundColor,
                (value) => { User.Default.BuferDefaultBackgroundColor = value; });

            this._showUserModeNotificationSetting = new SettingItem <bool>(
                false,
                User.Default.ShowUserModeNotification,
                (value) => { User.Default.ShowUserModeNotification = value; });

            this._restorePreviousSession = new SettingItem <bool>(
                true,
                User.Default.RestorePreviousSession,
                (value) => { User.Default.RestorePreviousSession = value; });

            this._pinnedBuferBackgroundColorSetting = new SettingItem <int>(
                Color.LightSlateGray.ToArgb(),
                User.Default.PinnedBuferBackgroundColor,
                (value) => { User.Default.PinnedBuferBackgroundColor = value; });

            this._currentBuferBackgroundColorSetting = new SettingItem <int>(
                Color.Silver.ToArgb(), // TODO (m) Consider new color: Color.LightGreen
                User.Default.CurrentBuferBackgroundColor,
                (value) => { User.Default.CurrentBuferBackgroundColor = value; });

            this._focusTooltipDurationSetting = new SettingItem <int>(
                2500,
                User.Default.FocusTooltipDuration,
                (value) => { User.Default.FocusTooltipDuration = value; });

            this._showFocusTooltipSetting = new SettingItem <bool>(
                true,
                User.Default.ShowFocusTooltip,
                (value) => { User.Default.ShowFocusTooltip = value; });

            this._settingItems = new List <ISettingItem>
            {
                this._buferDefaultBackgroundColorSetting,
                this._showUserModeNotificationSetting,
                this._restorePreviousSession,
                this._showFocusTooltipSetting,
                this._focusTooltipDurationSetting,
                this._pinnedBuferBackgroundColorSetting,
                this._currentBuferBackgroundColorSetting
            };

            this._defaultBufersFilePath = fileStorage.CombinePaths(
                fileStorage.DataDirectory,
                this.DefaultBufersFileName);

            if (!fileStorage.FileExists(this._defaultBufersFilePath))
            {
                fileStorage.CreateFile(this._defaultBufersFilePath);
            }
        }