internal override void LoadSettings()
        {
            base.LoadSettings();

            var namingPreferencesXml = this.OptionService.GetOption(SimplificationOptions.NamingPreferences, _languageName);

            SerializableNamingStylePreferencesInfo preferencesInfo;

            if (string.IsNullOrEmpty(namingPreferencesXml))
            {
                preferencesInfo = new SerializableNamingStylePreferencesInfo();
            }
            else
            {
                preferencesInfo = SerializableNamingStylePreferencesInfo.FromXElement(XElement.Parse(namingPreferencesXml));
            }

            _viewModel       = new NamingStylesOptionPageControlViewModel(preferencesInfo, _languageName, _categories, _notificationService);
            this.DataContext = _viewModel;

            this.RootTreeView.ItemsPath             = nameof(NamingRuleTreeItemViewModel.Children);
            this.RootTreeView.IsExpandablePath      = nameof(NamingRuleTreeItemViewModel.HasChildren);
            this.RootTreeView.FilterParentEvaluator = GetParent;
            this.RootTreeView.RootItemsSource       = new ObservableCollection <NamingRuleTreeItemViewModel>()
            {
                _viewModel.rootNamingRule
            };
        }
Exemplo n.º 2
0
        internal NamingRuleDialog(NamingRuleDialogViewModel viewModel, NamingStylesOptionPageControlViewModel outerViewModel, ImmutableArray<string> categories, INotificationService notificationService)
        {
            _notificationService = notificationService;
            _categories = categories;

            _viewModel = viewModel;
            _namingStylesViewModel = outerViewModel;

            InitializeComponent();
            DataContext = viewModel;
        }
Exemplo n.º 3
0
        internal NamingRuleDialog(NamingRuleDialogViewModel viewModel, NamingStylesOptionPageControlViewModel outerViewModel, ImmutableArray <string> categories, INotificationService notificationService)
        {
            _notificationService = notificationService;
            _categories          = categories;

            _viewModel             = viewModel;
            _namingStylesViewModel = outerViewModel;

            InitializeComponent();
            DataContext = viewModel;
        }
Exemplo n.º 4
0
        internal NamingRuleTreeItemViewModel(
            string name,
            SymbolSpecificationViewModel symbolSpec,
            NamingStyleViewModel namingStyle,
            EnforcementLevel enforcementLevel,
            NamingStylesOptionPageControlViewModel vm)
        {
            this.EnforcementLevel       = enforcementLevel;
            this._title                 = name;
            this.symbolSpec             = symbolSpec;
            this.namingStyle            = namingStyle;
            this._namingStylesViewModel = vm;

            this.children = new ChildRuleCollection(this);
            this.children.CollectionChanged += OnChildrenCollectionChanged;
        }
        internal override void LoadSettings()
        {
            base.LoadSettings();

            var namingPreferencesXml = this.OptionService.GetOption(SimplificationOptions.NamingPreferences, _languageName);

            SerializableNamingStylePreferencesInfo preferencesInfo;
            if (string.IsNullOrEmpty(namingPreferencesXml))
            {
                preferencesInfo = new SerializableNamingStylePreferencesInfo();
            }
            else
            {
                preferencesInfo = SerializableNamingStylePreferencesInfo.FromXElement(XElement.Parse(namingPreferencesXml));
            }

            _viewModel = new NamingStylesOptionPageControlViewModel(preferencesInfo, _languageName, _categories, _notificationService);
            this.DataContext = _viewModel;

            this.RootTreeView.ItemsPath = nameof(NamingRuleTreeItemViewModel.Children);
            this.RootTreeView.IsExpandablePath = nameof(NamingRuleTreeItemViewModel.HasChildren);
            this.RootTreeView.FilterParentEvaluator = GetParent;
            this.RootTreeView.RootItemsSource = new ObservableCollection<NamingRuleTreeItemViewModel>() { _viewModel.rootNamingRule };
        }