Exemple #1
0
        public void ChangeConverter(IByteCharConverter newConverter)
        {
            if (newConverter != CurrentConverter)
            {
                CurrentConverter = newConverter;
                if (MessageId != null)
                {
                    MessageIdString = CurrentConverter.ToString(MessageId);
                    OnPropertyChanged(nameof(MessageIdString));
                }
                if (MessageSource.ExtendedProperties.GroupId != null)
                {
                    var b = (byte[])MessageSource.ExtendedProperties.GroupId;
                    GroupIdString = CurrentConverter.ToString(b);
                    OnPropertyChanged(nameof(GroupIdString));
                }
                if (MessageSource.ExtendedProperties.CorrelationId != null)
                {
                    var b = (byte[])MessageSource.ExtendedProperties.CorrelationId;
                    CorrelationIdString = CurrentConverter.ToString(b);
                    OnPropertyChanged(nameof(CorrelationIdString));
                }

                if (HexLoader.IsValueCreated)
                {
                    HexLoader.Value.CharConverter = newConverter;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Updates the find buffer.
        /// </summary>
        internal void UpdateFindBuffer(IByteCharConverter byteCharConverter)
        {
            string text = this.Text != null ? this.Text : string.Empty;

            FindBuffer          = byteCharConverter.GetBytes(text);
            FindBufferLowerCase = byteCharConverter.GetBytes(text.ToLower());
            FindBufferUpperCase = byteCharConverter.GetBytes(text.ToUpper());
        }
Exemple #3
0
        private void comboBoxEncoding_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (encodingCombo.SelectedIndex == 0)
            {
                bcc = new DefaultByteCharConverter();
            }
            else
            {
                bcc = new ByteCharConveter(encodingCombo.Text);
            }

            hexBox1.ByteCharConverter = bcc;
        }
Exemple #4
0
        public HexViewerModel(byte[] data, IByteCharConverter converter = null)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            CharConverter = converter ?? new DefaultByteCharConverter();

            Data = data;
            var rowCount = data.Length / 16;

            if (data.Length % 16 != 0)
            {
                rowCount++;
            }

            Rows = new ObservableCollection <Array16Bytes>();
            for (var i = 0; i < rowCount; i++)
            {
                Rows.Add(new Array16Bytes(this, i));
            }
        }
Exemple #5
0
 public MessageInfo(IMessage message, IByteCharConverter converter, int indexOffset = 0)
 {
     CurrentConverter = converter;
     MessageSource    = message;
     BuildData(indexOffset);
 }
        public IEnumerable <MessageInfo> Browse(int numberOfMessages, BrowseFilter filter, CancellationToken ct, IProgress <int> progress, MessageInfo lastMessage, IByteCharConverter converter)
        {
            int indexOffset = 0;

            if (lastMessage != null && lastMessage.Index.HasValue)
            {
                indexOffset = lastMessage.Index.Value;
            }

            foreach (var msg in QueueSource.BrowseMessages(numberOfMessages, ct, lastMessage?.MessageId, filter, progress))
            {
                var mi = new MessageInfo(msg, converter, indexOffset);
                yield return(mi);
            }
        }
Exemple #7
0
        private void comboBoxEncoding_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (encodingCombo.SelectedIndex == 0)
                bcc = new DefaultByteCharConverter();
            else
                bcc = new ByteCharConveter(encodingCombo.Text);

            hexBox1.ByteCharConverter = bcc;
        }