public SettingsWindow(SettingsViewMode viewMode)
        {
            InitializeComponent();

            var dataContext = (SettingsWindowViewModel)DataContext;

            if (viewMode == SettingsViewMode.None)
            {
                dataContext.ViewMode = SettingsViewMode.General;
            }
            else
            {
                dataContext.ViewMode = viewMode;
            }
        }
Пример #2
0
        public SubSettingsVM(Area area, SettingsViewMode viewMode)
        {
            SaveCommand = new DelegateCommand(Save, () => IsDirty);

            _area     = area;
            _viewMode = viewMode;

            string error = null;

            switch (_viewMode)
            {
            case SettingsViewMode.Meta:
                _directives = DirectivesUtils.LoadVRMeta(_area, out error);
                break;

            case SettingsViewMode.UserGlobal:
                _directives = DirectivesUtils.LoadGlobalVRUser(out error);
                break;

            case SettingsViewMode.User:
                _directives = DirectivesUtils.LoadVRUser(_area, out error);
                break;

            case SettingsViewMode.Effective:
            default:
                _directives = _area.Directives;
                IsReadOnly  = true;
                break;
            }
            Error = (String.IsNullOrEmpty(error)) ? String.Empty : String.Format("{0}\nSaving changes will create a new file", error);

            if (_directives == null)
            {
                _directives = new Directives();
            }

            _ignores          = new IgnoresVM(_directives.Ignore, IsReadOnly);
            _ignores.Dirtied += (s, e) => IsDirty = true;

            _includes          = new IgnoresVM(_directives.Include, IsReadOnly);
            _includes.Dirtied += (s, e) => IsDirty = true;
        }
        private void ExecuteSettingsCommand(SettingsViewMode viewMode)
        {
            Logger.Instance.Information("Settings menu from icon in the task bar clicked. The settings window will be displayed");
            HideNotifyIcon();

            _pasteBarMustBeRecreatedAutomatically = false;
            _pasteBarWindow.Close();

            var window = new SettingsWindow(viewMode);

            window.ShowDialog();

            CreateNewPasteBar();

            Logger.Instance.Information("The settings window is closed.");
            ShowNotifyIcon();

            ServiceLocator.GetService <ClipboardService>().Reset();
            ServiceLocator.GetService <CloudStorageService>().Reset();
        }
    void SetModeAll( SettingsViewMode mode )
    {
        foreach(Type type in settingsTypes)
        {
            SetMode( type, mode );
        }

        _editors.Clear();
    }
 void SetMode( Type type, SettingsViewMode mode )
 {
     EditorPrefs.SetInt( "ViewMode" + type.Name, (int)mode );
 }
Пример #6
0
 private void OptionChanged(SettingsViewMode newOption)
 {
     ViewMode = newOption;
 }