dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Type.cs,1.14,1.15


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System Type.cs,1.14,1.15
Date: Tue, 18 Feb 2003 01:17:17 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv1343/runtime/System

Modified Files:
        Type.cs 
Log Message:


Add extra methods and properties to "System.Type" that are needed to reflect
generic types.


Index: Type.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Type.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Type.cs     14 Feb 2003 18:39:05 -0000      1.14
--- Type.cs     18 Feb 2003 06:17:14 -0000      1.15
***************
*** 1075,1078 ****
--- 1075,1140 ----
                        }
  
+       // Support for generic types follows.  Not strictly speaking
+       // ECMA-compatible, but will probably be ECMA eventually.
+ 
+       // Determine if this is a generic type.
+       protected virtual bool IsGenericTypeImpl()
+                       {
+                               throw new 
NotSupportedException(_("NotSupp_NotGenericType"));
+                       }
+ 
+       // Get the arity of a generic type.
+       protected virtual int ArityImpl()
+                       {
+                               throw new 
NotSupportedException(_("NotSupp_NotGenericType"));
+                       }
+ 
+       // Determine if this is a generic type that has been instantiated.
+       public bool IsInstantiatedTypeImpl()
+                       {
+                               return (GetInstantiation() != null);
+                       }
+ 
+       // Get the type parameters that were used to instantiate this type.
+       public virtual Type[] GetInstantiation()
+                       {
+                               throw new 
NotSupportedException(_("NotSupp_NotGenericType"));
+                       }
+ 
+       // Instantiate this generic type with a group of parameters.
+       public virtual Type Instantiate(Type[] inst)
+                       {
+                               throw new 
NotSupportedException(_("NotSupp_NotGenericType"));
+                       }
+ 
+       // Get the generic type that underlies this instantiated type.
+       public virtual Type GetGenericType()
+                       {
+                               throw new 
NotSupportedException(_("NotSupp_NotGenericType"));
+                       }
+ 
+       // Properties that wrap up the above.
+       public bool IsGenericType
+                       {
+                               get
+                               {
+                                       return IsGenericTypeImpl();
+                               }
+                       }
+       public int Arity
+                       {
+                               get
+                               {
+                                       return ArityImpl();
+                               }
+                       }
+       public bool IsInstantiatedType
+                       {
+                               get
+                               {
+                                       return IsInstantiatedTypeImpl();
+                               }
+                       }
+ 
  }; // class Type
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]