// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace MemoryStreamVisualizer; using System.Runtime.Serialization; /// /// ViewModel class representing a row of binary data. /// [DataContract] public class HexEditorRow { /// /// Initializes a new instance of the class. /// /// The index of this row. /// The bytes making up this row of data, in their hex representation. /// The bytes making up this row of data, in their Ascii representation. public HexEditorRow(int index, string data, string ascii) { this.Index = index; this.Data = data; this.Ascii = ascii; } /// /// Gets the index of this row. /// [DataMember] public int Index { get; } /// /// Gets the index of this row in hex format. /// [DataMember] public string HexIndex => $"{this.Index:X8}h"; /// /// Gets the bytes making up this row of data, in their hex representation. /// [DataMember] public string Data { get; } /// /// Gets the bytes making up this row of data, in their Ascii representation. /// [DataMember] public string Ascii { get; } }