public HexEditorSettings CopyTo(HexEditorSettings other) { other.BytesGroupCount = this.BytesGroupCount; other.BytesPerLine = this.BytesPerLine; other.UseHexPrefix = this.UseHexPrefix; other.ShowAscii = this.ShowAscii; other.LowerCaseHex = this.LowerCaseHex; other.FontFamily = this.FontFamily; other.FontSize = this.FontSize; other.AsciiEncoding = this.AsciiEncoding; return(other); }
public HexEditorAppSettingsVM(HexEditorSettings hexEditorSettings) { this.Settings = hexEditorSettings; this.AsciiEncodingVM = new EnumListVM(asciiEncodingList, (a, b) => hexEditorSettings.AsciiEncoding = (AsciiEncoding)AsciiEncodingVM.SelectedItem); this.BytesGroupCountVM = new Int32VM(a => { HasErrorUpdated(); hexEditorSettings.BytesGroupCount = BytesGroupCountVM.Value; }); this.BytesPerLineVM = new Int32VM(a => { HasErrorUpdated(); hexEditorSettings.BytesPerLine = BytesPerLineVM.Value; }) { Min = 0, Max = HexEditorSettings.MAX_BYTES_PER_LINE, }; AsciiEncodingVM.SelectedItem = hexEditorSettings.AsciiEncoding; BytesGroupCountVM.Value = hexEditorSettings.BytesGroupCount; BytesPerLineVM.Value = hexEditorSettings.BytesPerLine; FontFamily = hexEditorSettings.FontFamily; Task.Factory.StartNew(() => FontUtilities.GetMonospacedFonts()) .ContinueWith(t => { var ex = t.Exception; if (!t.IsCanceled && !t.IsFaulted) { FontFamilies = t.Result; } }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); }