public override bool View(DecompilerTextView textView)
{
try {
AvalonEditTextOutput output = new AvalonEditTextOutput();
Data.Position = 0;
BitmapImage image = new BitmapImage();
//HACK: windows imaging does not understand that .cur files have the same layout as .ico
// so load to data, and modify the ResourceType in the header to make look like an icon...
byte[] curData = ((MemoryStream)Data).ToArray();
curData[2] = 1;
using (Stream stream = new MemoryStream(curData)) {
image.BeginInit();
image.StreamSource = stream;
image.EndInit();
}
output.AddUIElement(() => new Image { Source = image });
output.WriteLine();
output.AddButton(Images.Save, "Save", delegate {
Save(null);
});
textView.ShowNode(output, this, null);
return true;
}
catch (Exception) {
return false;
}
}