Cosmos/source2/Users/Orvid/PlugViewer/TreeViewNodes/AssemblyTreeNode.cs
2011-08-16 02:46:07 +00:00

39 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using Mono.Cecil;
using System.Windows.Forms;
namespace PlugViewer.TreeViewNodes
{
internal class AssemblyTreeNode : OTreeNode
{
public AssemblyTreeNode(AssemblyDefinition definition)
{
this.def = definition;
this.SelectedImageIndex = Constants.AssemblyIcon;
this.ImageIndex = Constants.AssemblyIcon;
this.Text = definition.Name.Name;
Log.WriteLine("Assembly '" + this.Text + "' Was loaded successfully.");
}
public override TreeNodeType Type
{
get { return TreeNodeType.Assembly; }
}
private AssemblyDefinition def;
public override object Definition
{
get { return (object)def; }
}
public override void ShowNodeInfo(RichTextBox rtb)
{
rtb.Text =
"Assembly '" + def.Name.Name + "' contains:\r\n" +
def.Modules.Count.ToString() + " Modules.\r\n";
}
}
}