WinGridProxy Feature: Adds new Export command to file menu to allow exporting the decoded packet and message output for post processing

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3154 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-10-19 03:13:39 +00:00
parent c7b297c448
commit c2e6ba227a
2 changed files with 178 additions and 120 deletions

View File

@@ -1618,5 +1618,35 @@ namespace WinGridProxy
}
}
}
private void asDecodedTextToolStripMenuItem_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
StringBuilder outString = new StringBuilder();
foreach (ListViewItem item in listViewSessions.Items)
{
if (item.Tag is Packet)
{
outString.AppendLine(DecodePacket.PacketToString((Packet)item.Tag));
}
if (item.Tag is IMessage)
{
IMessage msg = (IMessage)item.Tag;
outString.AppendLine(msg.Serialize().ToString());
}
try
{
File.WriteAllText(saveFileDialog1.FileName, outString.ToString());
}
catch (Exception ex)
{
MessageBox.Show("Exception occurred trying to save session archive: " + ex);
}
}
}
}
}
}