public HexEditorAppSettingsVM(HexEditorSettings hexEditorSettings)
 {
     this.hexEditorSettings = 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(() => {
         AppCulture.InitializeCulture();
         return(FontUtils.GetMonospacedFonts());
     })
     .ContinueWith(t => {
         var ex = t.Exception;
         if (!t.IsCanceled && !t.IsFaulted)
         {
             FontFamilies = t.Result;
         }
     }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
 }
Beispiel #2
0
 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.hexEditorSettings = 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(() => {
         AppCulture.InitializeCulture();
         return FontUtils.GetMonospacedFonts();
     })
     .ContinueWith(t => {
         var ex = t.Exception;
         if (!t.IsCanceled && !t.IsFaulted)
             FontFamilies = t.Result;
     }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
 }
Beispiel #4
0
 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;
 }