mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
pretty...
This commit is contained in:
parent
beaf0cf939
commit
afafc6b032
285 changed files with 32688 additions and 784 deletions
77
CassiniDev/Views/BodyView.cs
Normal file
77
CassiniDev/Views/BodyView.cs
Normal file
|
@ -0,0 +1,77 @@
|
|||
// **********************************************************************************
|
||||
// CassiniDev - http://cassinidev.codeplex.com
|
||||
//
|
||||
// Copyright (c) Sky Sanders. All rights reserved.
|
||||
//
|
||||
// This source code is subject to terms and conditions of the Microsoft Public
|
||||
// License (Ms-PL). A copy of the license can be found in the license.htm file
|
||||
// included in this distribution.
|
||||
//
|
||||
// You must not remove this notice, or any other, from this software.
|
||||
//
|
||||
// **********************************************************************************
|
||||
|
||||
#region
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CassiniDev.ServerLog
|
||||
{
|
||||
[DefaultBindingProperty("Value")]
|
||||
public partial class BodyView : UserControl
|
||||
{
|
||||
private byte[] _value;
|
||||
|
||||
public BodyView()
|
||||
{
|
||||
InitializeComponent();
|
||||
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
}
|
||||
|
||||
public Byte[] Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
_value = value;
|
||||
ClearDisplay();
|
||||
if (_value != null)
|
||||
{
|
||||
HexViewTextBox.Text = _value.ConvertToHexView(8);
|
||||
TextViewTextBox.Text = Encoding.UTF8.GetString(_value);
|
||||
try
|
||||
{
|
||||
using (MemoryStream s = new MemoryStream(_value))
|
||||
{
|
||||
pictureBox1.Image = Image.FromStream(s);
|
||||
}
|
||||
pictureBox1.Visible = true;
|
||||
}
|
||||
// ReSharper disable EmptyGeneralCatchClause
|
||||
catch
|
||||
// ReSharper restore EmptyGeneralCatchClause
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearDisplay()
|
||||
{
|
||||
if (pictureBox1.Image != null)
|
||||
{
|
||||
pictureBox1.Image.Dispose();
|
||||
pictureBox1.Image = null;
|
||||
}
|
||||
HexViewTextBox.Text = "";
|
||||
TextViewTextBox.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue