Esempio n. 1
0
 public FontAndColorOptionsVM(FontAndColorOptions options, FontCollection fontCollection)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     if (fontCollection == null)
     {
         throw new ArgumentNullException(nameof(fontCollection));
     }
     this.options   = options;
     FontCollection = fontCollection;
     fontFamilyVM   = new FontFamilyVM(FontFamily);
 }
Esempio n. 2
0
        public FontAppSettingsPage(TextEditorSettingsImpl textEditorSettings)
        {
            if (textEditorSettings == null)
            {
                throw new ArgumentNullException(nameof(textEditorSettings));
            }
            this.textEditorSettings = textEditorSettings;

            FontFamily = textEditorSettings.FontFamily;
            FontSize   = textEditorSettings.FontSize;

            this.fontFamilies = null;
            this.fontFamilyVM = new FontFamilyVM(FontFamily);
            Task.Factory.StartNew(() =>
                                  Fonts.SystemFontFamilies.Where(a => !FontUtilities.IsSymbol(a)).OrderBy(a => a.Source.ToUpperInvariant()).Select(a => new FontFamilyVM(a)).ToArray()
                                  )
            .ContinueWith(t => {
                var ex = t.Exception;
                if (!t.IsCanceled && !t.IsFaulted)
                {
                    FontFamilies = t.Result;
                }
            }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
        }
Esempio n. 3
0
		public FontAndColorOptionsVM(FontAndColorOptions options, FontCollection fontCollection) {
			if (options == null)
				throw new ArgumentNullException(nameof(options));
			if (fontCollection == null)
				throw new ArgumentNullException(nameof(fontCollection));
			this.options = options;
			FontCollection = fontCollection;
			fontFamilyVM = new FontFamilyVM(FontFamily);
		}