This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Move

svn path=/old-code/; revision=157322
  • Loading branch information...
migueldeicaza committed May 13, 2010
1 parent 780148a commit 30e96e3731bd96425479da590303d78bb1a65818
Showing with 9,128 additions and 0 deletions.
  1. +1 −0 type-reflector/.cvsignore
  2. +66 −0 type-reflector/AssemblyInfo.cs
  3. +24 −0 type-reflector/COPYRIGHT
  4. +422 −0 type-reflector/ChangeLog
  5. +121 −0 type-reflector/DESIGN
  6. +51 −0 type-reflector/Factories.cs
  7. +20 −0 type-reflector/IPolicy.cs
  8. +24 −0 type-reflector/LICENSE
  9. +240 −0 type-reflector/Makefile
  10. +83 −0 type-reflector/Node.cs
  11. +49 −0 type-reflector/NodeGrouper.cs
  12. +177 −0 type-reflector/NodeInfo.cs
  13. +37 −0 type-reflector/NodeTypes.cs
  14. +41 −0 type-reflector/Policy.cs
  15. +390 −0 type-reflector/ProgramOptions.cs
  16. +128 −0 type-reflector/README
  17. +16 −0 type-reflector/TODO
  18. +168 −0 type-reflector/TestTypes.cs
  19. +162 −0 type-reflector/TextFormatter.cs
  20. +166 −0 type-reflector/TypeFactory.cs
  21. +189 −0 type-reflector/TypeLoader.cs
  22. +316 −0 type-reflector/TypeReflectorApp.cs
  23. +473 −0 type-reflector/TypeReflectorOptions.cs
  24. +24 −0 type-reflector/displayers/ChangeLog
  25. +96 −0 type-reflector/displayers/ConsoleTypeDisplayer.cs
  26. +36 −0 type-reflector/displayers/ITypeDisplayer.cs
  27. +162 −0 type-reflector/displayers/IndentingTextWriter.cs
  28. +141 −0 type-reflector/displayers/TypeDisplayer.cs
  29. BIN type-reflector/displayers/art/abstract.png
  30. BIN type-reflector/displayers/art/class.png
  31. BIN type-reflector/displayers/art/constructor.png
  32. BIN type-reflector/displayers/art/enum.png
  33. BIN type-reflector/displayers/art/event.png
  34. BIN type-reflector/displayers/art/field.png
  35. BIN type-reflector/displayers/art/interface.png
  36. BIN type-reflector/displayers/art/method.png
  37. BIN type-reflector/displayers/art/prop-read-only.png
  38. BIN type-reflector/displayers/art/prop-read-write.png
  39. BIN type-reflector/displayers/art/prop-write-only.png
  40. BIN type-reflector/displayers/art/sealed.png
  41. BIN type-reflector/displayers/art/transparent.png
  42. +313 −0 type-reflector/displayers/gtk/AppWindowManager.cs
  43. +129 −0 type-reflector/displayers/gtk/ChangeLog
  44. +1,019 −0 type-reflector/displayers/gtk/GtkTypeDisplayer.cs
  45. +1,055 −0 type-reflector/displayers/gtk/type-reflector.glade
  46. +8 −0 type-reflector/displayers/gtk/type-reflector.gladep
  47. +20 −0 type-reflector/displayers/swf/ChangeLog
  48. +243 −0 type-reflector/displayers/swf/SwfTypeDisplayer.cs
  49. +349 −0 type-reflector/displayers/swf/SwfWindow.cs
  50. +8 −0 type-reflector/finders/ChangeLog
  51. +362 −0 type-reflector/finders/ExplicitNodeFinder.cs
  52. +184 −0 type-reflector/finders/GroupingNodeFinder.cs
  53. +43 −0 type-reflector/finders/INodeFinder.cs
  54. +333 −0 type-reflector/finders/NodeFinder.cs
  55. +168 −0 type-reflector/finders/ReflectionNodeFinder.cs
  56. +64 −0 type-reflector/formatters/CSharpNodeFormatter.cs
  57. +20 −0 type-reflector/formatters/ChangeLog
  58. +55 −0 type-reflector/formatters/DefaultNodeFormatter.cs
  59. +25 −0 type-reflector/formatters/INodeFormatter.cs
  60. +502 −0 type-reflector/formatters/LanguageNodeFormatter.cs
  61. +207 −0 type-reflector/formatters/NodeFormatter.cs
  62. +81 −0 type-reflector/formatters/VBNodeFormatter.cs
  63. +17 −0 type-reflector/type-reflector
  64. +12 −0 type-reflector/type-reflector.build
  65. +69 −0 type-reflector/type-reflector.exe.config
  66. +5 −0 type-reflector/type-reflector.in
  67. +14 −0 type-reflector/unix.args
@@ -0,0 +1 @@
+*.pdb
@@ -0,0 +1,66 @@
+//
+// AssemblyInfo.cs: Assembly information
+//
+// Author: Jonathan Pryor (jonpryor@vt.edu)
+//
+// (C) 2003 Jonathan Pryor
+//
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("Type Reflector")]
+[assembly: AssemblyDescription("Displays System.Reflection Information for .NET Types")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Jon Pryor Research Labs")]
+[assembly: AssemblyProduct("Type Reflector")]
+[assembly: AssemblyCopyright("Copyright (C) 2002-2003")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("0.6.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
View
@@ -0,0 +1,24 @@
+Type Reflector (C) 2002 Jonathan Pryor
+
+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.
+
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,121 @@
+Overview:
+--------
+The major design is that of a connected model & controller. No view (as in
+MVC) is needed because the data that is modelled will never change--it's
+information about types, which must be static (or the CLR gets mad).
+
+The main problem (at this point) is one of future directions: I'd like to have
+a GUI front-end. Ideally, the GUI and console front-ends would use the same
+internal representation, which we could format as desired (e.g. format for
+different languages such as C#, Visual Basic, CLOS, Eiffel, etc.).
+
+
+GUI Issues:
+----------
+Additionally, with the GUI we don't want the entire tree to be generated --
+that would take too long. We want sub-nodes to be expanded only when required
+(the user clicks on them), and not sooner.
+
+The GUI actually becomes the most complicated design consideration. If we
+have a tree, we need to show to the user that the tree can be expanded by
+having a `+' next to it. This is typically done by having sub-nodes under the
+node to click. But these are the nodes we want to avoid displaying!
+
+I can think of two solutions to this: show them anyway, but not *their*
+children (so we only need to generate two levels when starting -- the
+top-level elements and their immediate children). We thus always have the
+children -- permitting (somewhat) rapid expansion of tree nodes, but when the
+children are displayed we'll have to grab the grand-children.
+
+Alternatively, instead of having the children available, we have a single
+placeholder available, and the first time the `+' is clicked we remove the
+placeholder and generate the immediate children that should be displayed.
+
+The problem with either of these approaches is that it requires that type
+displaying be interruptable. The 0.2 version had it simpler -- it would
+stream the type information to the console, following all children as it found
+them. This was simple, but it didn't permit a GUI view.
+
+Hopefully, all of these issues can be handled in the design below.
+
+
+Categories:
+----------
+I would like to retain the current 0.2 behavior of categorizing the output,
+where a category would be Fields, Methods, Properties, Constructors, etc.
+
+The question becomes: how is this supported? We want (e.g.) all interfaces to
+be grouped together; who maintains the grouping?
+
+Answer: NodeGrouper.
+
+
+Nodes:
+-----
+
+A node is an element in a tree hierarchy. In a GUI, it would be the
+underyling dat for an item in a tree-view (hierarchical display widget).
+It has a display string. It has sub-nodes (children). It also has an
+associated `object' which could be used for
+additional output possibilities. (This isn't explored very far, but I can see
+it as being useful. The `object' would be a Type instance for class names, a
+`MemberInfo' for members, etc.)
+
+Nodes have three classes associated with them: a NodeFormatter, which formats
+the display string described above. It also has a NodeFinder object, which is
+used to determine which sub-nodes will be displayed. Finally, it has a
+NodeInfo instance, which collects various information about the node such as
+its type (NodeTypes) and related information.
+
+The NodeInfo type is used as the sole communication between NodeFinder and
+NodeFormatter. A NodeFinder returns a collection of NodeInfo objects, each of
+which is sent to the NodeFormatter object before being displayed.
+
+Categorization can be done through "decorators" (see GoF) on the NodeFinder.
+
+
+Design:
+------
+
+ Controller [View]
+ \ /
+ \ /
+ Node
+ / | \
+ / | \
+ INodeFormatter INode- NodeInfo
+ Finder
+
+
+Controller:
+ - GUI App, Console Main program
+ -- Controls output, display
+
+[View]:
+ - Display device for Nodes.
+ - Note quite MVC; there's no feedback mechanism so that Views change when
+ the Node changes
+ - Nodes can't change; the type system is static
+ - However, this could be added in the future if necessary.
+
+Node (Model)
+ - Members:
+ - string Description {get; set;}
+ -- The display string
+ - NodeInfo NodeInfo {get;}
+ -- Information about this node
+ - NodeCollection GetChildren ();
+ -- Returns the sub-nodes of this node
+
+INodeFormatter:
+ -- Formats a node for output (particular language, etc.)
+ - Methods:
+ - string GetDescription (NodeInfo)
+ - LanguageFormatter
+ - CSharpFormatter, ...
+
+INodeFinder:
+ -- Decides which children are present
+ - Members:
+ - NodeInfoCollection GetChildren(NodeInfo);
+
@@ -0,0 +1,51 @@
+//
+// Factory.cs: Declares finder and formatter policy factories
+//
+// Author: Jonathan Pryor (jonpryor@vt.edu)
+//
+// (C) 2002 Jonathan Pryor
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.Text;
+
+using Mono.TypeReflector.Displayers;
+using Mono.TypeReflector.Finders;
+using Mono.TypeReflector.Formatters;
+
+namespace Mono.TypeReflector
+{
+ public sealed class Factories
+ {
+ public sealed class FinderTypeFactory : TypeFactory
+ {
+ public new INodeFinder Create (object key)
+ {
+ return (INodeFinder) base.Create (key);
+ }
+ }
+
+ public sealed class FormatterTypeFactory : TypeFactory
+ {
+ public new INodeFormatter Create (object key)
+ {
+ return (INodeFormatter) base.Create (key);
+ }
+ }
+
+ public sealed class DisplayerTypeFactory : TypeFactory
+ {
+ public new ITypeDisplayer Create (object key)
+ {
+ return (ITypeDisplayer) base.Create (key);
+ }
+ }
+
+ public static FinderTypeFactory Finder = new FinderTypeFactory ();
+ public static FormatterTypeFactory Formatter = new FormatterTypeFactory ();
+ public static DisplayerTypeFactory Displayer = new DisplayerTypeFactory ();
+ }
+}
+
View
@@ -0,0 +1,20 @@
+//
+// INodePolicy.cs: Root Policy interface to describe other policies.
+//
+// Author: Jonathan Pryor (jonpryor@vt.edu)
+//
+// (C) 2003 Jonathan Pryor
+//
+
+using System;
+
+namespace Mono.TypeReflector
+{
+ public interface IPolicy : ICloneable {
+
+ string Description {get; set;}
+ string FactoryKey {get; set;}
+
+ }
+}
+
View
@@ -0,0 +1,24 @@
+Copyright (C) 2002 Jonathan Pryor
+
+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.
+
Oops, something went wrong.

0 comments on commit 30e96e3

Please sign in to comment.