.NET的类型层次查看工具
没找到现成合用的工具,只好自己写一个了。于是就用C#/WinForms写了一个简单的GUI程序,只是用来显示类型层次信息,并且能把类型层次以文本形式复制到剪贴板。
截图一张:

对应这张截图得到的文本表示:
- IList<T>
- Collection<T>
- KeyedCollection<TKey, TItem>
- List<T>
- ReadOnlyCollection<T>
===========================================================================
开源形式:
该程序采用MIT形式的许可证开放源代码。程序与源码可在本帖附件的压缩包中获得。
运行环境:
由于使用了LINQ,这个程序需要.NET Framework 3.5才能正常运行。如果需要移植到.NET Framework 2.0的话,可以使用Mono的System.Core.dll的实现。
===========================================================================
使用方法:
可以从命令行提供参数来打开assembly,格式为:
ClassHierarchyViewer <assembly-path>
或者直接启动程序,并通过以下三种方式的任意一种来打开assembly:
1、在文本框中输入assembly的完整名称(Name,Version,Culture,PublicKeyToken),并按回车或点击“Load By Name”按钮;
2、按“Open File...”按钮通过对话框选取assembly;
3、从文件浏览器把assembly拖放到该程序的窗口里。
同一时间只会有一个assembly显示在窗口中。
其它功能应该不言而喻了,我就直接把readme文件的内容帖出来吧:
Name: ClassHierarchyViewer
Author: RednaxelaFX (Kris Mok, rednaxela0607@hotmail.com)
Version: 0.3.0.1
Release Date: 2008-09-23
License: MIT style license. See License.txt.
////////////////////////////////////////////////////////////////
Description:
A simple tool that shows the class hierarchy within a given
.NET assembly.
Required Environment:
Windows XP or Vista, with .NET Framework 3.5 or above installed.
////////////////////////////////////////////////////////////////
Usage:
1. Start program from command line:
usage: ClassHierarchyViewer <assembly-path>
- or -
2. Start program from GUI:
Assemblies can be loaded by one of:
* enter the assembly's full name in the combobox, then click
"Load By Name" button;
* enter the assembly's full name in the combobox, and hit
Enter;
* Click "Open File..." button, and choose an assembly file;
* Drag and drop a assembly file from Explorer.
Only one assembly is active at a time.
A few commonly used BCL assemblies' names are added to the
combox already, including:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.AddIn, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac
System.Net, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
////////////////////////////////////////////////////////////////
Functions:
The GUI window is divided into 3 major components:
1. Class List Window (on the left)
Displays all types (except "<Module>") in the given assembly,
grouped by their namespaces, sorted by the type's name.
Types that are not visible outside the assembly are marked gray.
2. Class Hierarchy Window (on the upper right)
When a type is selected in the Class List Window, its type
hierarchy will be shown in this window.
The hierarchy shown includes the type itself, its base type (up
to System.Object), and all its derived types.
Checking/unchecking the "Full Name" checkbox will cause this
window to reload, showing types with their simple name/full name.
Clicking "Copy to Clipboard" button will copy the type hierarchy
to the clipboard, in text representaion.
3. Class Member Window (on the lower right)
When a type is selected in the Class Hierarchy Window, its
members will be shown in this window. This does not include
a type's nested types.
Checking/unchecking the "Use Alias" checkbox will cause this
window to reload, showing types with their alias/name.
////////////////////////////////////////////////////////////////
Known Issues:
1. TreeViews flicker when mouse moves over them rapidly.
Haven't found any solution to this, maybe that's just how
WinForms behaves.
2. Copying the type hierarchy causes flickering.
This is because of the way data is loaded: derived types are
added onto the tree when a node is expanded. To make sure
derived types are added correctly, the whole tree is expanded
before its text representation can be gathered. This will be
improved in later versions with M-V-VM pattern.
3. Properties' getter and setter methods aren't associated with
the properties' nodes.
Due to the lack of developing time, certain useful functions
such as this one is not implemented yet. Will be fixed in
later versions.
4. Doesn't show what interfaces a type implements.
Same as above. Will be fixed.
5. Cannot load an assembly from GAC just by browsing in the open
file dialog.
I know. That's why there's an alternative, to load assemblies
with their full names. Later on I might add a dialog to select
assemblies from GAC.
////////////////////////////////////////////////////////////////
Note:
The icons used in this program originated from Microsoft Visual
Studio 2008's image libraries, Visual Studio Image Library:
24bit Objects and Objects (WinVista style, .png).
许可证:
Copyright (c) 2008 RednaxelaFX (Kris Mok, rednaxela0607@hotmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
现在这个简陋的程序最大的限制就是无法自如的打开GAC里的assembly,因为在Windows上安装.NET
Framework之后,GAC目录默认会被Fusion管理起来,需要通过修改注册表来禁用这个功能才能看到GAC里的assembly的路径。当然,
我可以扫描%WINDOWS%\Assembly\下的所有assembly,不过这个功能还没做进来;别的类似程序在扫描GAC时非常慢,所以我不太肯
定要不要把这个功能做进来。现在通过强名称一样能打开GAC里的assembly,只是用户会辛苦一点了。预先放在文本框的下拉列表里的名称应该能满足一
般使用需要了吧。
如果有什么意见和建议,欢迎提出。有需要请通过站内短信或者电子邮件联系,谢谢 ^ ^
- ClassHierarchyViewer_0.3.zip (1 MB)
.NET的类型层次查看工具的更多相关文章
- SQLSERVER图片查看工具SQL Image Viewer5.5.0.156
原文:SQLSERVER图片查看工具SQL Image Viewer5.5.0.156 SQLSERVER图片查看工具SQL Image Viewer5.5.0.156 在2013年某一次北京SQL ...
- python中数字类型与处理工具
python中的数字类型工具 python中为更高级的工作提供很多高级数字编程支持和对象,其中数字类型的完整工具包括: 1.整数与浮点型, 2.复数, 3.固定精度十进制数, 4.有理分数, 5.集合 ...
- Atitit.java 虚拟机的构成 与指令分类 与 指令集合 以及字节码查看工具javjap
Atitit.java 虚拟机的构成 与指令分类 与 指令集合 以及字节码查看工具javjap 1.1. 虚拟机的构成 java虚拟机--处理器.堆栈.寄存器.指令系统. 1 1.2. 虚拟机执行过程 ...
- Centos安装nmap端口查看工具
CentOS安装nmap端口查看工具 一.安装nmap yum install nmap #输入y安装 二.使用nmap nmap localhost #查看主机当前开放的端口 ...
- 分享一款高逼格的Linux磁盘信息查看工具
关注「开源Linux」,选择"设为星标" 回复「学习」,有我为您特别筛选的学习资料~ 可以使用df命令来显示在Linux.macOS和类Unix系统中挂载的文件系统上有多少可用磁盘 ...
- LogViewer - 方便的日志查看工具
一个完整的程序日志记录功能是必不可少的,通过日志我们可以了解程序运行详情.错误信息等,以便更好的发现及解决问题. 日志可以记录到数据库.日志服务器.文件等地方,本文主要介绍文件日志. 文件日志通常是一 ...
- iOS及时log日志查看工具 (iConsole)
github下载地址:https://github.com/nicklockwood/iConsole 偶然看到的一个iOS及时log日志查看工具,通过该工具,我们可以在任何想看日志的时候,通过手势呼 ...
- Windows日志查看工具合集
欢迎关注我的社交账号: 博客园地址: http://www.cnblogs.com/jiangxinnju GitHub地址: https://github.com/jiangxincode 知乎地址 ...
- hexdump——Linux系统的二进制文件查看工具
hexdump是Linux下的一个二进制文件查看工具,可以将二进制文件转换为ASCII.10进制.16进制或8进制进行查看. 首先我们准备一个测试用的文件test,十六进制如下: 00 01 02 0 ...
随机推荐
- spring Cache注解
如下:不能将缓存注解加在listCate(boolean isShowHide)方法上 因为spring是使用AOP的方法获取缓存,在一个bean中再去调用别一个方法,不会应用缓存 @Cacheabl ...
- Colored Linux Man pages
Colored Linux Man pages 一.什么是Linux Man 参考: 二.如何高效率地使用Man 三.给Linux Man命令添加点颜色. 1.Unix / Linux: Displa ...
- linux下screen工具的简单使用
有时候,希望即使退出终端了,下次登录linux的时候,还能回到程序的控制界面,这个时候,screen工具就很有用了例如,写了一个从控制台读取屏幕输入的程序input_test,如果从终端退出了,下次登 ...
- 第二章 Qt常用工具的介绍
第二章 Qt常用工具的介绍 (1)No.1 qmake 相信编写过Makefile的开发人员,随着工程中源码的级数递增和以类型.功能.模块组织源码的子目录的增多,都不愿意重复机械地手工编写这个工程管理 ...
- grunt学习
有些时候,项目中的静态资源,比如图片占用的文件有点大,影响加载的速度,所以会选择grunt对其进行压缩打包.对于grunt其他的用法,还在继续学习中,先记录下关于grunt的一些学习. grunt是一 ...
- Python3 内建模块 datetime/collections/base64/struct
datetime 我们先看如何获取当前日期和时间: >>> from datetime import datetime >>> now = datetime.now ...
- c#中多线程访问winform控件的若干问题
我们在做winform应用的时候,大部分情况下都会碰到使用多线程控制界面上控件信息的问题.然而我们并不能用传统方法来解决这个问题,下面我将详细的介绍. 首先来看传统方法: public partial ...
- Win2008 R2 IIS7.5+PHP5(FastCGI)+MySQL5环境搭建教程
现在很多朋友想尝试win2008 r2来跑web服务器,跟win2003相比界面差别有点大,有些人可能不太习惯,不过以后是趋势啊,这里简单分享下,方便需要的朋友 准备篇 一.环境说明: 操作系统:Wi ...
- iis7以上版本权限控制
IIS7.5中(仅win7,win2008 SP2,win2008 R2支持),应用程序池的运行帐号,除了指定为LocalService,LocalSystem,NetWorkService这三种基本 ...
- 字符编码笔记:ASCII,Unicode和UTF-8【转载】
作者: 阮一峰 日期: 2007年10月28日 今天中午,我突然想搞清楚Unicode和UTF-8之间的关系,于是就开始在网上查资料. 结果,这个问题比我想象的复杂,从午饭后一直看到晚上9点,才算初步 ...