62 lines
1.8 KiB
C#
62 lines
1.8 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using UAF.Remoting;
|
|
|
|
namespace MemoryViewer
|
|
{
|
|
public partial class DetailedActor : Form
|
|
{
|
|
public DetailedActor()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void DetailedActor_Load(object sender, EventArgs e)
|
|
{
|
|
sendCommand("dump_detailedactor", null);
|
|
|
|
gridInstance.BorderStyle = BorderStyle.FixedSingle;
|
|
gridInstance.ColumnsCount = 4;
|
|
gridInstance.FixedRows = 1;
|
|
gridInstance.Rows.Insert(0);
|
|
|
|
gridInstance[0, 0] = new SourceGrid.Cells.ColumnHeader("Actor Name");
|
|
gridInstance[0, 1] = new SourceGrid.Cells.ColumnHeader("Memory Size");
|
|
|
|
|
|
gridInstance.Columns[0].Width = 300;
|
|
gridInstance.Columns[0].AutoSizeMode = SourceGrid.AutoSizeMode.None;
|
|
|
|
|
|
gridInstance.AutoSizeCells();
|
|
}
|
|
|
|
private void sendCommand(string _command, params object[] args)
|
|
{
|
|
//call back
|
|
callbackAction cbAction = (callbackAction)Tag;
|
|
if (cbAction != null)
|
|
cbAction(GetType().ToString(), _command, args);
|
|
}
|
|
|
|
public void dump(IBlob _currentBlob)
|
|
{
|
|
uint count = 0;
|
|
_currentBlob.Extract(out count);
|
|
|
|
for (int index = 0; index < count; index++)
|
|
{
|
|
string name = "";
|
|
_currentBlob.Extract(out name);
|
|
uint memory = 0;
|
|
_currentBlob.Extract(out memory);
|
|
|
|
int r = index + 1;
|
|
|
|
gridInstance.Rows.Insert(r);
|
|
gridInstance[r, 0] = new SourceGrid.Cells.Cell(name.ToString(), typeof(string));
|
|
gridInstance[r, 1] = new SourceGrid.Cells.Cell(memory, typeof(uint));
|
|
}
|
|
}
|
|
}
|
|
}
|