示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SyntaxHighlightingItem"/> class.
        /// </summary>
        /// <param name="textExtension">The text editor extension.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="textExtension"/> is <see langword="null"/>.
        /// </exception>
        public SyntaxHighlightingItem(TextExtension textExtension)
        {
            if (textExtension == null)
            {
                throw new ArgumentNullException(nameof(textExtension));
            }

            _textExtension       = textExtension;
            _highlightingService = textExtension.Editor.Services.GetInstance <IHighlightingService>().ThrowIfMissing();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextEditorOptionsPageViewModel"/> class.
        /// </summary>
        /// <param name="textExtension">The <see cref="TextExtension"/>.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="textExtension"/> is <see langword="null"/>.
        /// </exception>
        public TextEditorOptionsPageViewModel(TextExtension textExtension)
            : base("Text Editor")
        {
            if (textExtension == null)
            {
                throw new ArgumentNullException(nameof(textExtension));
            }

            _textExtension     = textExtension;
            Options            = new TextEditorOptions();
            SetDefaultsCommand = new DelegateCommand(SetDefaults);
            SelectFontCommand  = new DelegateCommand(SelectFont);

            _fontStretchConverter = new FontStretchConverter();
            _fontStyleConverter   = new FontStyleConverter();
            _fontWeightConverter  = new FontWeightConverter();
        }