Cosmos/source2/Users/Orvid/PlugViewer/TreeViewNodes/AssemblyTreeNode.cs

41 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) : base(TreeNodeType.Assembly)
{
this.def = definition;
this.SelectedImageIndex = Constants.AssemblyIcon;
this.ImageIndex = Constants.AssemblyIcon;
this.Text = definition.Name.Name;
#if DebugTreeNodeLoading
Log.WriteLine("Assembly '" + this.Text + "' Was loaded successfully.");
#endif
}
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";
}
}
}