Example #1
0
 void InitializeFrom(LocalGroupOptions options)
 {
     ShowOffsetColumn      = options.ShowOffsetColumn;
     ShowValuesColumn      = options.ShowValuesColumn;
     ShowAsciiColumn       = options.ShowAsciiColumn;
     StartPositionVM.Value = options.StartPosition.ToUInt64();
     EndPositionVM.Value   = (options.EndPosition > HexPosition.Zero ? options.EndPosition - 1 : options.EndPosition).ToUInt64();
     BasePositionVM.Value  = options.BasePosition.ToUInt64();
     UseRelativePositions  = options.UseRelativePositions;
     OffsetBitSizeVM.Value = options.OffsetBitSize;
     HexValuesDisplayFormatVM.SelectedItem = options.HexValuesDisplayFormat;
     BytesPerLineVM.Value = options.BytesPerLine;
 }
		public override LocalGroupOptions GetDefaultLocalOptions(HexView hexView) {
			if (hexView == null)
				throw new ArgumentNullException(nameof(hexView));
			var options = new LocalGroupOptions();
			options.ShowOffsetColumn = true;
			options.ShowValuesColumn = true;
			options.ShowAsciiColumn = true;
			options.StartPosition = hexView.Buffer.Span.Start;
			options.EndPosition = hexView.Buffer.Span.End;
			options.BasePosition = HexPosition.Zero;
			options.UseRelativePositions = false;
			options.OffsetBitSize = 0;
			options.HexValuesDisplayFormat = HexValuesDisplayFormat.HexByte;
			options.BytesPerLine = 0;
			return options;
		}
Example #3
0
		public LocalSettingsVM(LocalGroupOptions options, LocalGroupOptions defaultOptions) {
			origOptions = options;
			this.defaultOptions = defaultOptions;
			BytesPerLineVM = new Int32VM(a => HasErrorUpdated(), true) {
				Min = HexBufferLineProviderOptions.MinBytesPerLine,
				Max = HexBufferLineProviderOptions.MaxBytesPerLine,
			};
			OffsetBitSizeVM = new Int32VM(a => HasErrorUpdated(), true) {
				Min = HexBufferLineProviderOptions.MinOffsetBitSize,
				Max = HexBufferLineProviderOptions.MaxOffsetBitSize,
			};
			BasePositionVM = new UInt64VM(a => HasErrorUpdated());
			StartPositionVM = new UInt64VM(a => HasErrorUpdated());
			EndPositionVM = new UInt64VM(a => HasErrorUpdated());
			HexValuesDisplayFormatVM = new EnumListVM(hexValuesDisplayFormatList);

			Reinitialize();
		}
        public override LocalGroupOptions GetDefaultLocalOptions(HexView hexView)
        {
            if (hexView == null)
            {
                throw new ArgumentNullException(nameof(hexView));
            }
            var options = new LocalGroupOptions();

            options.ShowOffsetColumn       = true;
            options.ShowValuesColumn       = true;
            options.ShowAsciiColumn        = true;
            options.StartPosition          = hexView.Buffer.Span.Start;
            options.EndPosition            = hexView.Buffer.Span.End;
            options.BasePosition           = HexPosition.Zero;
            options.UseRelativePositions   = false;
            options.OffsetBitSize          = 0;
            options.HexValuesDisplayFormat = HexValuesDisplayFormat.HexByte;
            options.BytesPerLine           = 0;
            return(options);
        }
Example #5
0
        public LocalSettingsVM(LocalGroupOptions options, LocalGroupOptions defaultOptions)
        {
            origOptions         = options;
            this.defaultOptions = defaultOptions;
            BytesPerLineVM      = new Int32VM(a => HasErrorUpdated(), true)
            {
                Min = HexBufferLineFormatterOptions.MinBytesPerLine,
                Max = HexBufferLineFormatterOptions.MaxBytesPerLine,
            };
            OffsetBitSizeVM = new Int32VM(a => HasErrorUpdated(), true)
            {
                Min = HexBufferLineFormatterOptions.MinOffsetBitSize,
                Max = HexBufferLineFormatterOptions.MaxOffsetBitSize,
            };
            BasePositionVM           = new UInt64VM(a => HasErrorUpdated());
            StartPositionVM          = new UInt64VM(a => HasErrorUpdated());
            EndPositionVM            = new UInt64VM(a => HasErrorUpdated());
            HexValuesDisplayFormatVM = new EnumListVM(hexValuesDisplayFormatList);

            Reinitialize();
        }
Example #6
0
        public LocalGroupOptions TryGetLocalGroupOptions()
        {
            var options = new LocalGroupOptions();

            options.ShowOffsetColumn = ShowOffsetColumn;
            options.ShowValuesColumn = ShowValuesColumn;
            options.ShowAsciiColumn  = ShowAsciiColumn;
            if (StartPositionVM.HasError)
            {
                return(null);
            }
            options.StartPosition = StartPositionVM.Value;
            if (EndPositionVM.HasError)
            {
                return(null);
            }
            options.EndPosition = new HexPosition(EndPositionVM.Value) + 1;
            if (BasePositionVM.HasError)
            {
                return(null);
            }
            options.BasePosition         = BasePositionVM.Value;
            options.UseRelativePositions = UseRelativePositions;
            if (OffsetBitSizeVM.HasError)
            {
                return(null);
            }
            options.OffsetBitSize          = OffsetBitSizeVM.Value;
            options.HexValuesDisplayFormat = (HexValuesDisplayFormat)HexValuesDisplayFormatVM.SelectedItem;
            if (BytesPerLineVM.HasError)
            {
                return(null);
            }
            options.BytesPerLine = BytesPerLineVM.Value;
            return(options);
        }
Example #7
0
		void InitializeFrom(LocalGroupOptions options) {
			ShowOffsetColumn = options.ShowOffsetColumn;
			ShowValuesColumn = options.ShowValuesColumn;
			ShowAsciiColumn = options.ShowAsciiColumn;
			StartPositionVM.Value = options.StartPosition.ToUInt64();
			EndPositionVM.Value = (options.EndPosition > HexPosition.Zero ? options.EndPosition - 1 : options.EndPosition).ToUInt64();
			BasePositionVM.Value = options.BasePosition.ToUInt64();
			UseRelativePositions = options.UseRelativePositions;
			OffsetBitSizeVM.Value = options.OffsetBitSize;
			HexValuesDisplayFormatVM.SelectedItem = options.HexValuesDisplayFormat;
			BytesPerLineVM.Value = options.BytesPerLine;
		}
Example #8
0
		public LocalGroupOptions TryGetLocalGroupOptions() {
			var options = new LocalGroupOptions();
			options.ShowOffsetColumn = ShowOffsetColumn;
			options.ShowValuesColumn = ShowValuesColumn;
			options.ShowAsciiColumn = ShowAsciiColumn;
			if (StartPositionVM.HasError)
				return null;
			options.StartPosition = StartPositionVM.Value;
			if (EndPositionVM.HasError)
				return null;
			options.EndPosition = new HexPosition(EndPositionVM.Value) + 1;
			if (BasePositionVM.HasError)
				return null;
			options.BasePosition = BasePositionVM.Value;
			options.UseRelativePositions = UseRelativePositions;
			if (OffsetBitSizeVM.HasError)
				return null;
			options.OffsetBitSize = OffsetBitSizeVM.Value;
			options.HexValuesDisplayFormat = (HexValuesDisplayFormat)HexValuesDisplayFormatVM.SelectedItem;
			if (BytesPerLineVM.HasError)
				return null;
			options.BytesPerLine = BytesPerLineVM.Value;
			return options;
		}