home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / ClsView / Browser.aspx < prev    next >
Encoding:
Text File  |  2000-06-23  |  24.2 KB  |  713 lines

  1. <%
  2. /*=====================================================================
  3.   File:      Browser.aspx
  4.  
  5.   Summary:   Brief summary of the file contents and purpose.
  6.  
  7. ---------------------------------------------------------------------
  8.   This file is part of the Microsoft NGWS SDK Code Samples.
  9.  
  10.   Copyright (C) 2000 Microsoft Corporation.  All rights reserved.
  11.  
  12. This source code is intended only as a supplement to Microsoft
  13. Development Tools and/or on-line documentation.  See these other
  14. materials for detailed information regarding Microsoft code samples.
  15.  
  16. THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  17. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  18. IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  19. PARTICULAR PURPOSE.
  20. =====================================================================*/
  21.  
  22. %>
  23.  
  24. <%@ Page Language="C#" %>
  25. <%@ Import Namespace="System.Data.XML"%>
  26. <%@ Import Namespace="System.Data.XML.DOM"%>
  27. <%@ Import Namespace="System.Reflection" %>
  28. <%@ Import Namespace="System.Collections" %>
  29. <%@ Import Namespace="System.IO"     %>
  30. <%@ Import Namespace="System.Threading"     %>
  31. <%@ Import Namespace="System.Text"     %>
  32. <%@ Import Namespace="LangUtil"     %>
  33.  
  34.         
  35.         <Script runat=server>
  36.  
  37. //        Set up variables global to class.
  38.  
  39.         public NativeConstructorInfo[]            Constructors        = null;
  40.         public NativeFieldInfo[]                Fields                 = null;
  41.         public NativeEventInfo[]                Events                 = null;
  42.         public NativeMethodInfo[]                Methods             = null;
  43.         public System.Collections.ArrayList        Properties             = new System.Collections.ArrayList();
  44.         public System.Collections.ArrayList        Interfaces             = new System.Collections.ArrayList();
  45.         public NativeLangType                    ThisLangType        = null;
  46.  
  47.         public String                            ClassName            = "";
  48.         public String                            Description            = "";
  49.         public String                            ContentVersion        = "";
  50.         public String                            DocBuildTimestamp    = "";
  51.         public Type[]                            Hierarchy            = null;
  52.  
  53.         public Type                                ThisType            = null;
  54.         
  55.         public static String                    ClassViewPath        = null;
  56.  
  57.         
  58.  
  59.         /****************************************************************************************
  60.                 
  61.             Description GetDescriptionFromXML(Type myClass)
  62.  
  63.             This method takes a Type for the class and returns
  64.             a string representing either the description of the class
  65.             or a string message. 
  66.                 
  67.         *****************************************************************************************/
  68.         
  69.         public static String GetDescriptionFromXML(Type myClass){
  70.  
  71.             String Description = String.Format("<pre>This class resides in {0}</pre>", Assembly.GetAssembly(myClass).GetName());
  72.  
  73.             /* This method will retrieve some content from an XML file, if it exists. 
  74.             // The sample does not currently include such content.
  75.             // confirm this class lives in a namespace
  76.             if (myClass.FullName.LastIndexOf(".") != -1) {
  77.                                 
  78.                 String myPath = GetUEPath(myClass.FullName);
  79.  
  80.                 if (!(File.FileExists(myPath)))
  81.                     Description = Description + "CONTENT NOT AVAILABLE.</pre>";
  82.                 else{
  83.                     XmlDocument XMLData = new XmlDocument();
  84.  
  85.                     // XmlDocuments require an XmlReader to load if you don't have a DataSet.
  86.                     // load the XmlReader for this file
  87.                     XMLData.Load(new XmlReader(myPath));
  88.  
  89.                     IDocument XMLdoc = XMLData.DomDocument;
  90.                     // make sure loading the file encounters no complications
  91.                     Monitor.Enter(XMLdoc);
  92.                     try{
  93.                         try{
  94.                             XMLdoc.load(myPath);
  95.                             Description = Description 
  96.                                 + "Content Updated " 
  97.                                 + XMLdoc.documentElement.attributes.getNamedItem("timestamp").nodeValue    
  98.                                 + ".</pre>";
  99.                             Description = Description + XMLdoc.documentElement.childNodes.item(0).text;
  100.                         }
  101.                          catch(Exception e){
  102.                             // catch validation errors
  103.                             Description = Description + "CONTENT NOT AVAILABLE.</pre>";
  104.                         }
  105.                     }
  106.                     finally{
  107.                         Monitor.Exit(XMLdoc);
  108.                     }
  109.                  }
  110.             }
  111.             */
  112.             return Description;            
  113.         }
  114.  
  115.     /*******************************************************************************************
  116.  
  117.         GetPath takes a string and returns a string for the path to the descriptive content. 
  118.         
  119.     *******************************************************************************************/
  120.  
  121.         public static String GetUEPath(String TempName){
  122.             int index;
  123.             StringBuilder myPath = new StringBuilder(ClassViewPath);
  124.             while ((index = TempName.IndexOf(".")) != -1){
  125.                 myPath.Append("\\" + TempName.Substring(0, index));
  126.                 TempName = TempName.Remove(0, index + 1);
  127.             }
  128.             
  129.             myPath.Append("\\" + TempName + ".xml");
  130.             return myPath.ToString();
  131.         }            
  132.  
  133.  
  134.     /************************************************************************************
  135.         
  136.         MakeClassLink takes a NativeLangType and a bool 
  137.         and returns a string that represents an <A HREF ></A> string for 
  138.         the class. The FullName is displayed if the FullName argument is true.
  139.  
  140.     ************************************************************************************/
  141.  
  142.         public String MakeClassLink(NativeLangType NatLangType, bool FullName){
  143.             StringBuilder link = new StringBuilder("<A HREF=\"Browser.aspx?class=");
  144.             link.Append(NatLangType.FullClassName);
  145.             link.Append("\" Title=\"");
  146.             link.Append(NatLangType.FullClassName);
  147.             link.Append("\">");
  148.             if (FullName)
  149.                 link.Append(NatLangType.FullClassName);
  150.             else
  151.                 link.Append(NatLangType.ClassName);
  152.             link.Append("</A>"); 
  153.             
  154.             return link.ToString();
  155.             return NatLangType.FullClassName;
  156.         }
  157.  
  158.         /* one-off method to make the name of this class a link to the constructor for this class.
  159.              Used only in MakeSimpleClassConst();
  160.         */
  161.  
  162.         public String MakeConstMemberLink(NativeLangType NatLangType, NativeConstructorInfo NativeConstInfo){
  163.             StringBuilder link = new StringBuilder("<A HREF=\"member.aspx?class=");
  164.             link.Append(NatLangType.FullClassName);
  165.             link.Append("&member=");
  166.             link.Append(NativeConstInfo.Name);
  167.             link.Append("&type=constructor"); 
  168.             link.Append("\">");
  169.             link.Append("<B>" + NatLangType.ClassName + "</B>");
  170.             link.Append("</A>");
  171.             
  172.             return link.ToString();
  173.         }
  174.  
  175.  
  176.     /************************************************************************************
  177.  
  178.         MakeLangSimpleClassConst takes a NativeConstructorInfo and returns a string
  179.         that represents a simple block to display for a constructor. Does not display 
  180.         variables or "exotic" qualifiers/access fields.
  181.  
  182.     *************************************************************************************/
  183.         
  184.         public String MakeLangSimpleClassConst(NativeConstructorInfo LangConstInfo){
  185.             StringBuilder Simple = new StringBuilder(String.Empty);
  186.             if (LangConstInfo.ThisConstructorInfo.IsStatic) 
  187.                 Simple.Append("<span class=\"StaticIcon\" style=\"color:red\" title=\"Static member\">[S]</span> "); 
  188.             if (LangConstInfo.ThisConstructorInfo.DeclaringType != ThisType){
  189.                     Response.Write("<span class=\"Inherited\" style=\"color:red\" title=\"Inherited from: " + LangConstInfo.ThisConstructorInfo.DeclaringType.FullName + "\">[I]</span> "); 
  190.             }
  191.  
  192.             if (LangConstInfo.Name.Equals(".cctor")){
  193.                 Simple.Append(".cctor");
  194.             }
  195.             else {
  196.                 Simple.Append(MakeConstMemberLink(ThisLangType, LangConstInfo));
  197.             }
  198.             Simple.Append(" (");
  199.             for (int j = 0; j < LangConstInfo.Parameters.Count; ++j) { 
  200.                 if (((NativeLangType)(LangConstInfo.Parameters[j])).IsByRef){
  201.                     Simple.Append("ByRef ");
  202.                 }
  203.                 
  204.                 Simple.Append(MakeClassLink((NativeLangType)(LangConstInfo.Parameters[j]), false));
  205.                 if (((NativeLangType)(LangConstInfo.Parameters[j])).ThisType.IsArray){
  206.                     Simple.Append("[]");
  207.                 }
  208.                 if (((NativeLangType)(LangConstInfo.Parameters[j])).IsByRef){
  209.                     Simple.Append("&");
  210.                 }
  211.                 if (((NativeLangType)(LangConstInfo.Parameters[j])).IsPointer){
  212.                     Simple.Append("*");
  213.                 }
  214.                 Simple.Append(" <I>");
  215.                 Simple.Append(((NativeLangType)LangConstInfo.Parameters[j]).ParamVarName);
  216.                 Simple.Append("</I>");
  217.                 if (j != (LangConstInfo.Parameters.Count - 1)) { 
  218.                     Simple.Append(", "); 
  219.                 }
  220.                 else{
  221.                     if (LangConstInfo.VarArgs)
  222.                         Simple.Append(", ...");
  223.                 } 
  224.             } 
  225.             Simple.Append(")");
  226.             return Simple.ToString();        
  227.         }
  228.  
  229.     /*************************************************************************************
  230.  
  231.  
  232.         
  233.                 
  234.     **************************************************************************************/
  235.         
  236.         public String MakeLangSimpleClassMethod(NativeMethodInfo MethLangInfo){
  237.             StringBuilder Simple = new StringBuilder(400);
  238.             if (MethLangInfo.ThisMethodInfo.IsStatic)
  239.                 Simple.Append("<span class=\"StaticIcon\" style=\"color:red\" title=\"Static member\">[S]</span> ");
  240.             if (MethLangInfo.ThisMethodInfo.DeclaringType != ThisType)
  241.                 {
  242.                 Simple.Append("<A class=\"Inherited\" HREF=\""
  243.                     + "browser.aspx?class="
  244.                      + MethLangInfo.ThisMethodInfo.DeclaringType.FullName
  245.                     + "\" title=\"Inherited from: " 
  246.                     + MethLangInfo.ThisMethodInfo.DeclaringType.FullName 
  247.                     + "\">[I]</A> "
  248.                 );
  249.             }
  250.  
  251. // Bug: this name isn't filtered.
  252.             Simple.Append(MethLangInfo.ReturnLangType.ClassName);
  253.             if (MethLangInfo.ReturnLangType.IsArray)
  254.                 Simple.Append("[]");
  255.             if (MethLangInfo.ReturnLangType.IsPointer)
  256.                 Simple.Append("*");
  257.             if (MethLangInfo.ReturnLangType.IsByRef)
  258.                 Simple.Append("&");
  259.  
  260.             Simple.Append(" <A HREF=\"Member.aspx?class=" 
  261.                 + ThisLangType.FullClassName 
  262.                 + "&member="
  263.                 + MethLangInfo.Name
  264.                 + "&type=method\"><B>"
  265.                 + MethLangInfo.Name
  266.                 + "</B></A>");
  267.             Simple.Append(" (");
  268.             for (int j = 0; j < MethLangInfo.Parameters.Count; ++j) {
  269.                 
  270.                 Simple.Append(MakeClassLink((NativeLangType)(MethLangInfo.Parameters[j]), false));
  271.                 if (((NativeLangType)(MethLangInfo.Parameters[j])).ThisType.IsArray){
  272.                     Simple.Append("[]");
  273.                 }
  274.                 if (((NativeLangType)(MethLangInfo.Parameters[j])).IsPointer){
  275.                     Simple.Append("*");
  276.                 }
  277.                 if (((NativeLangType)(MethLangInfo.Parameters[j])).IsByRef){
  278.                     Simple.Append("&");
  279.                 }
  280.             
  281.                 Simple.Append(" <I>");
  282.                 Simple.Append(((NativeLangType)MethLangInfo.Parameters[j]).ParamVarName);
  283.                 Simple.Append("</I>");                
  284.                 if (j != (MethLangInfo.Parameters.Count - 1)) { 
  285.                     Simple.Append(", "); 
  286.                 }
  287.                 else{
  288.                     if (MethLangInfo.VarArgs)
  289.                         Simple.Append(", ...");
  290.                 }                  
  291.             } 
  292.             Simple.Append(")");
  293.             return Simple.ToString();        
  294.         }
  295.  
  296. /*
  297.  
  298.     Method returns a Type whose friendly name is a case-insensitive match with
  299.     what the user entered. It also writes to the TextWriter stream, in this case
  300.     the HtmlTextWriter associated with this page, the names of the choices you have if
  301.     you have more than one. The modules it searches through are hard-coded.
  302.  
  303. */
  304.  
  305.     public Type PluralTypesGetShortNameTypeInsensitive(String ClassName, TextWriter OutWriter){
  306.  
  307.  
  308.         Type ThisType = null;
  309.         Module ThisMod = null;
  310.         Module[] TheseModules;
  311.         bool FoundTypes = false;
  312.         int iNumFoundTypes = 0;
  313.         Type[] CurrentModTypes = null;
  314.         System.Collections.ArrayList TypeLinkStrings = new System.Collections.ArrayList();
  315.         System.Collections.ArrayList Assemblies = (ArrayList)Session["Assems"];
  316.  
  317.         for (int i = 0; i < Assemblies.Count; ++i){
  318.             try{
  319.                 Assembly Temp = Assembly.Load((string)Assemblies[i]);
  320.                 if (Temp == null){
  321.                     Page.Response.Write("Run-time error: Assembly " + (string)Assemblies[i] + " refused to be loaded.<BR>");
  322.                     continue;
  323.                 }                
  324.                 TheseModules = Temp.GetModules();
  325.                 if (TheseModules == null){
  326.                     continue;
  327.                 }
  328.                 else{
  329.                         
  330.                     for (int j = 0; j < TheseModules.Length; ++j){
  331.                         CurrentModTypes = TheseModules[j].GetTypes();
  332.                         for (int iTypeCount = 0; iTypeCount < CurrentModTypes.Length; ++iTypeCount){
  333.                             if (CurrentModTypes[iTypeCount] != null 
  334.                                 && CurrentModTypes[iTypeCount].IsPublic
  335.                                 && (String.Compare(CurrentModTypes[iTypeCount].Name, ClassName, true) == 0)
  336.                             ){
  337.                                 ++iNumFoundTypes;
  338.                                 ThisType = CurrentModTypes[iTypeCount];
  339.                                 if (!FoundTypes){
  340.                                     FoundTypes = true;
  341.                                 }
  342.                                 TypeLinkStrings.Add(MakeClassLink(new NativeLangType(CurrentModTypes[iTypeCount]), true) + "<BR>");
  343.                             }
  344.                         }
  345.                     }
  346.                 }
  347.             }
  348.             catch(Exception Ex){
  349.                 continue;
  350.             }
  351.         }
  352.         if (TypeLinkStrings.Count > 1){
  353.             OutWriter.WriteLine("The following classes were found: <BR>");
  354.             for (int iLinkCount = 0; iLinkCount < TypeLinkStrings.Count; ++iLinkCount)
  355.                 OutWriter.WriteLine((String)TypeLinkStrings[iLinkCount]);
  356.         }
  357.         return ThisType;
  358.     } 
  359.  
  360.  
  361.  
  362.     /***************************************************/
  363.  
  364.  
  365.     
  366. //        Use Load as the main for the Web request.            
  367.         
  368.         void Page_Load(Object sender, EventArgs EvArgs){
  369.             try{
  370.                 if (Request.Form.Count > 0){
  371.                     NameValueCollection FormSubmission = Request.Form;                
  372.                     ClassName = FormSubmission["ThisClass"];
  373.                 }
  374.                 else{
  375.                     ClassName = Request.QueryString["class"];
  376.                 }
  377.  
  378.                 // Determine path of this application
  379.                 ClassViewPath = Request.PhysicalApplicationPath;
  380.                 ClassViewPath = ClassViewPath.Remove(ClassViewPath.LastIndexOf('\\'), 1);
  381.  
  382.                 // catch a misspelling in the input box and react appropriately
  383.                 try{
  384.                     ThisType = Type.GetType(ClassName, true);
  385.                     if (ThisType == null)
  386.                     throw new TypeLoadException(String.Format("Unable to load {0}.", ClassName));
  387.                 }
  388.                 catch(Exception e){
  389.  
  390.                     if ((ThisType = PluralTypesGetShortNameTypeInsensitive(ClassName, Response.Output)) == null){
  391.                         Response.Write(String.Format("<p>Unable to load {0}. Is the spelling and case correct?</p>", ClassName));
  392.                         ClassName = "System.Object";
  393.                         ThisType = Type.GetType("System.Object", true);
  394.                     }
  395.                     else{
  396.                         ClassName = ThisType.Name;
  397.                     }
  398.                 }    
  399.                 
  400.  
  401.                 Description = GetDescriptionFromXML(ThisType);
  402.  
  403.                 NativeLangType ThisOrderedType = new NativeLangType(ThisType);
  404.                 ThisLangType = ThisOrderedType;
  405.         
  406.                 // Get Hierarchy 
  407.                 LangUtil.HTMLHierTree TypeTree = new LangUtil.HTMLHierTree();
  408.                 Hierarchy = LangUtil.HTMLHierTree.GetTree(ThisType);
  409.  
  410.  
  411.                 // Obtain Class Interface Details
  412.                 Type [] myInterfaces = ThisType.GetInterfaces();
  413.                 for (int x=0; x < myInterfaces.Length; x++)
  414.                     Interfaces.Add(myInterfaces[x].Name);
  415.  
  416.                 // Obtain Class Constructor Details
  417.                 Constructors = ThisOrderedType.OrderedNativeConstructors;
  418.  
  419.  
  420.                 // Obtain Class Method Details
  421.                 Methods = ThisOrderedType.OrderedNativeMethods;
  422.  
  423.                // Obtain Class Field Details
  424.                 Fields = ThisOrderedType.OrderedNativeFields;    
  425.  
  426.                // Obtain Class Field Details
  427.                 Events = ThisOrderedType.OrderedNativeEvents;    
  428.  
  429.                 // Obtain Class Property Details
  430.                 for (int x=0; x < ThisOrderedType.OrderedProperties.Length; x++){
  431.                     try{
  432.                         NativePropertyInfo temp = new NativePropertyInfo(ThisOrderedType.OrderedProperties[x]);
  433.                         Properties.Add(temp);
  434.                     }
  435.                     catch(Exception Ex){
  436.                         throw new Exception("This happened in Properties loop.", Ex);
  437.                         continue;
  438.                     }
  439.                 }        
  440.  
  441.             }
  442.             catch(Exception Ex){
  443.  
  444.                 Response.Write(Ex.GetType().Name + " caught: " + Ex.Message);
  445.                 Exception inner = Ex.InnerException;
  446.                 while (inner != null){
  447.                     Response.Write("<BR>InnerException is : " 
  448.                         + inner.GetType().Name
  449.                         + " --> "
  450.                         + inner.Message);
  451.                     inner = inner.InnerException;
  452.                 }
  453.             }
  454.         } //END OF Load
  455.  
  456.     </Script>
  457. <HTML>
  458.     <HEAD>
  459.         <style type="text/css">
  460.          @import url(backSDK4.css);
  461.         </style>
  462.         <style ID="PrivateStyle" type="text/css">
  463.             .InAccessible{display:none};
  464.         </style>
  465.         <Title>ClassView: Microsoft NGWS SDK <%=""%></Title>
  466.     
  467.  
  468.    </HEAD>
  469. <Script Language="JavaScript1.1">
  470.     function DisplaySheets(){
  471.         // alert(document.styleSheets.length.toString() + " style sheets.");
  472.     }
  473. </Script>
  474.    <Body onload="DisplaySheets()">
  475.     
  476. <%
  477. /* Uncomment this to view the headers on the page.
  478.  
  479. String[] keys, values;
  480.  
  481. keys = Request.ServerVariables.AllKeys;
  482. values = Request.ServerVariables.All;
  483. Response.Output.WriteLine("<pre>");
  484. for(int i = 0; i < keys.Length; i++)
  485. {
  486.   Response.Output.WriteLine("{0} -> {1}", keys[i], values[i]);
  487. }
  488. Response.Output.WriteLine("</pre><HR>");
  489.  
  490. */
  491.  
  492. %>
  493.     <H2><%=ThisType.FullName%></H2> 
  494.  
  495.     <%=Description%>
  496.     
  497.     <!-- START OF HIERARCHY  -->
  498.     <%
  499.      int ObjectCount = 0; 
  500.         for (int i = 0; i < Hierarchy.Length; ++i) { %>
  501.         <% if (i == 0) { %>
  502.          <H4>Hierarchy</H4>
  503.          <A Title="<%=Hierarchy[i].FullName%>" HREF="?class=<%=Hierarchy[i].FullName%>"><%=Hierarchy[i].Name%></A>
  504.          <% ++ObjectCount;} %>
  505.             
  506.         <% 
  507.          if (i !=0 ) {
  508.                 if (Hierarchy[i].IsInterface) {
  509.                     Response.Write(" -- "); 
  510.                     Response.Write(
  511.                         "<A Title=" 
  512.                         + Hierarchy[i].FullName 
  513.                         + " HREF=\"?class=" 
  514.                         + Hierarchy[i].FullName 
  515.                         + "\">" 
  516.                         + Hierarchy[i].Name 
  517.                         + "</A>"
  518.                     );
  519.                 }
  520.                 else {
  521.                     Response.Write("<BR>");
  522.                     for (int IndentCount = 0; IndentCount < ObjectCount; ++IndentCount) 
  523.                         Response.Write("    ");
  524.                     ++ObjectCount;
  525.  
  526.                     if (Hierarchy[i] != ThisType)
  527.                         Response.Write(
  528.                             "+ " 
  529.                             + "<A Title=" 
  530.                             + Hierarchy[i].FullName 
  531.                             + " HREF=\"?class=" 
  532.                             + Hierarchy[i].FullName 
  533.                             + "\">" 
  534.                             + Hierarchy[i].Name 
  535.                             + "</A>");    
  536.                     else {
  537.                         %> + <b><%=ThisType.Name%></b>
  538.  
  539.                         <% 
  540.                     }
  541.                 }
  542.             }
  543.         %>
  544.         
  545.         <% if (i == Hierarchy.Length - 1) { Response.Write(""); } %>
  546.         
  547.     <% }
  548.      %>
  549.     <!-- END OF HIERARCHY  -->
  550. <!-- Start of Declaration -->
  551.  
  552. <h4>Declarations</h4><pre><span style="color: blue">[C#]</span> <%=(new CSharpLangType(ThisType)).TextDeclaration%>
  553. <span style="color: blue">[Visual Basic]</span> <%=(new VisualBasicLangType(ThisType)).TextDeclaration%>
  554. <span style="color: blue">[MC++]</span> <%=(new MCLangType(ThisType)).TextDeclaration%></pre>
  555.  
  556. <!-- START OF REF PAGE METADATA -->
  557.     
  558.     <!-- START OF CONSTRUCTOR SECTION  -->        
  559.         <% 
  560.         
  561.             
  562.         for (int i = 0; i < Constructors.Length; ++i) { %>
  563.             <% if (i == 0) { Response.Write("<H4>Constructors</H4><table>"); } %>
  564.             <tr <%
  565.                     // this turns off accessors.
  566.  
  567.                     if (
  568.  
  569.                     (Constructors[i].ThisConstructorInfo.IsSpecialName &&    (Constructors[i].Name.StartsWith("get_") || Constructors[i].Name.StartsWith("set_")))
  570.                     || (Constructors[i].ThisConstructorInfo.IsPrivate || Constructors[i].ThisConstructorInfo.IsFamilyAndAssembly || Constructors[i].ThisConstructorInfo.IsAssembly)
  571.     //                || (Constructors[i].ThisConstructorInfo.DeclaringType == typeof(object) && (Constructors[i].ThisConstructorInfo.ReflectedType != typeof(object)))
  572.                     
  573.                     )
  574.                          Response.Write("class=\"InAccessible\"");
  575.  
  576.                     %>>
  577.                 <td width=100%>
  578.                     <%=MakeLangSimpleClassConst(Constructors[i])%>
  579.                     <BR>
  580.                     <%
  581.                     
  582.                     %>
  583.                 </td>
  584.             </tr>
  585.             
  586.             <% if (i == Constructors.Length - 1) { Response.Write("</table>"); } %>
  587.  
  588.         <% } // end constructor loop %>
  589.     <!-- END OF CONSTRUCTOR SECTION -->
  590.  
  591.     <!-- START OF METHODS SECTION  -->    
  592.         <% for (int i = 0; i < Methods.Length; ++i) { %>
  593.             <% 
  594.             if (i == 0) { Response.Write("<H4>Methods</H4><table>"); } %>
  595.                 <tr <%
  596.                     // this turns off accessors.
  597.  
  598.                     if (
  599.  
  600.                     (Methods[i].ThisMethodInfo.IsSpecialName &&    (Methods[i].Name.StartsWith("get_") || Methods[i].Name.StartsWith("set_")))
  601.                     || (Methods[i].ThisMethodInfo.IsPrivate || Methods[i].ThisMethodInfo.IsFamilyAndAssembly || Methods[i].ThisMethodInfo.IsAssembly)
  602.     //                || (Methods[i].ThisMethodInfo.DeclaringType == typeof(object) && (Methods[i].ThisMethodInfo.ReflectedType != typeof(object)))
  603.                     
  604.                     )
  605.                          Response.Write("class=\"InAccessible\"");
  606.  
  607.                     %>>
  608.                     <td width=100%>
  609.                          <% 
  610.                             Object[] Atts = Methods[i].GetAttributeArray(Methods[i].ThisMethodInfo);
  611.                             if (Atts.Length > 0){
  612.                                 for (int j = 0; j < Atts.Length; ++j){
  613.                                     if (j != 0) Response.Write(", ");
  614.                                     if (Atts[j] is System.ObsoleteAttribute)
  615.                                         Response.Write("<A HREF=\"Browser.aspx?class=" + Atts[j].GetType().FullName + "\" class=\"Attribute\" style=\"color: red;\" title=\"" + Atts[j].GetType().Name + ":\n\r" + ((ObsoleteAttribute)Atts[j]).Message + "\">[Attr]</A> ");
  616.                                     else if (Atts[j] is System.CLSCompliantAttribute)
  617.                                         Response.Write("<A HREF=\"Browser.aspx?class=" + Atts[j].GetType().FullName + "\" class=\"Attribute\" style=\"color: red;\" title=\"" + Atts[j].GetType().Name + ": " + ((CLSCompliantAttribute)Atts[j]).IsCompliant.ToString() + "\">[Attr]</A>");
  618.                                     else if (Atts[j] is System.AttributeUsageAttribute){
  619.                                         Response.Write("<A HREF=\"Browser.aspx?class=" 
  620.                                             + Atts[j].GetType().FullName 
  621.                                             + "\" class=\"Attribute\" style=\"color: red;\" title=\"" 
  622.                                             + Atts[j].GetType().Name 
  623.                                             + ": \n\r\tAllowMultiple: " 
  624.                                             + ((AttributeUsageAttribute)Atts[j]).AllowMultiple.ToString() 
  625.                                             + ",\n\r\tInherited: "
  626.                                             + ((AttributeUsageAttribute)Atts[j]).Inherited.ToString()
  627.                                             + ",\n\rValid on:\n\r"
  628.                                             + ((AttributeUsageAttribute)Atts[j]).ValidOn.ToString()
  629.                                             + "\">[Attr]</A>");
  630.                                     }
  631.                                     else
  632.                                         Response.Write("<A HREF=\"Browser.aspx?class=" + Atts[j].GetType().FullName + "\" class=\"Attribute\" style=\"color: red;\" title=\"" + Atts[j].GetType().Name + "\">[Attr]</A>");
  633.                                 }
  634.                             }
  635.                         %><%=MakeLangSimpleClassMethod(Methods[i])%>
  636.                     </td>
  637.                 </tr>
  638.             <% if (i == Methods.Length - 1) { Response.Write("</table>"); } %>
  639.         <% } %>
  640.     <!-- END OF METHODS SECTION  -->        
  641.         
  642.     <!-- START OF PROPERTIES SECTION  -->    
  643.         <% for (int i = 0; i < Properties.Count; ++i) { %>
  644.             <% if (i == 0) { Response.Write("<H4>Properties</H4><table>"); } %>
  645.                 <tr >
  646.                     <td width=100%>
  647.                         <% if (((NativePropertyInfo)Properties[i]).ThisPropertyInfo.DeclaringType != ThisType){
  648.                                 Response.Write("<span class=\"Inherited\" style=\"color:red\" title=\"Inherited from: " + ((NativePropertyInfo)Properties[i]).ThisPropertyInfo.DeclaringType.FullName + "\">[I]</span> "); 
  649.                             }
  650.                         %>
  651.                         <%=((NativePropertyInfo)Properties[i]).GetSetLangType.ClassName%> 
  652.                         <A HREF="Member.aspx?class=<%=ThisType.FullName%>&member=<%=((NativePropertyInfo)Properties[i]).Name%>&type=property"><B><%=((NativePropertyInfo)Properties[i]).Name%><B></A>
  653.                     </td>
  654.                 </tr>
  655.             <% if (i == Properties.Count - 1) { Response.Write("</table>"); } %>
  656.         <% } %>
  657.     <!-- END OF PROPERTIES SECTION  -->        
  658.  
  659.     <!-- START OF FIELDS SECTION  -->    
  660.         <%     for (int i = 0; i < Fields.Length; ++i) { %>
  661.             <% if (i == 0) { Response.Write("<H4>Fields</H4><table>"); } %>
  662.                 <tr <%
  663.                     // this turns off accessors.
  664.  
  665.                     if (
  666.                     (Fields[i].ThisFieldInfo.IsPrivate || Fields[i].ThisFieldInfo.IsFamilyAndAssembly || Fields[i].ThisFieldInfo.IsAssembly)
  667.                     || (Fields[i].ThisFieldInfo.DeclaringType == typeof(object) && (Fields[i].ThisFieldInfo.ReflectedType != typeof(object)))
  668.                     
  669.                     )
  670.                     ;/*    Response.Write("style=\"display:none;\""); */
  671.  
  672.                     %>>
  673.                     <td width=100%>
  674.                         <%  if (Fields[i].ThisFieldInfo.IsStatic) Response.Write("<span style=\"color:red\" title=\"Static member\">[S]</span> "); %>
  675.                         <% if (Fields[i].ThisFieldInfo.DeclaringType != ThisType){
  676.                                 Response.Write("<span class=\"Inherited\" style=\"color:red\" title=\"Inherited from: " + Fields[i].ThisFieldInfo.DeclaringType.FullName + "\">[I]</span> "); 
  677.                             }
  678.                         %>
  679.                         <%=Fields[i].FieldLangType.ClassName%>
  680.                         <A HREF="Member.aspx?class=<%=ThisType.FullName%>&member=<%=Fields[i].Name%>&type=field"><B><%=Fields[i].Name%></B></A>
  681.                         <%
  682.                         if (!Fields[i].FieldValue.Equals(String.Empty))
  683.                             Response.Write(" = " + Fields[i].FieldValue + ";");
  684.                         %>
  685.                     </td>
  686.                 </tr>
  687.             <% if (i == Fields.Length - 1) { Response.Write("</table>"); } %>
  688.         <% } %>
  689.     <!-- END OF FIELDS SECTION  -->        
  690.     
  691.     <!-- START OF Events SECTION  -->    
  692.     <% 
  693.     
  694.  
  695.     %>
  696.         <% for (int i = 0; i < Events.Length; ++i) { %>
  697.             <% if (i == 0) { Response.Write("<H4>Events</H4><table>"); } %>
  698.                 <tr>
  699.                     <td width=50%>
  700.                         <% /*if (Events[i].ThisEventInfo.IsStatic) Response.Write("<span style=\"color:red\" title=\"Static member\">[S]</span> "); */ %>
  701.                         <A HREF="Member.aspx?class=<%=ThisType.FullName%>&member=<%=Events[i].Name%>&type=event"><B><%=Events[i].Name%></B></A>
  702.                     </td>
  703.                 </tr>
  704.             <% if (i == Events.Length - 1) { Response.Write("</table>"); } %>
  705.         <% } %>
  706.     <!-- END OF Events SECTION  -->        
  707.  
  708. <!-- END OF THE REF PAGE METADATA -->
  709.  
  710.    </Body>
  711. </HTML>
  712.                 
  713.