[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Reflection Assembly.c
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Reflection Assembly.cs,1.25,1.26 AssemblyName.cs,1.2,1.3 Module.cs,1.9,1.10 TypeDelegator.cs,1.1,1.2 |
Date: |
Thu, 24 Apr 2003 23:53:09 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection
In directory subversions:/tmp/cvs-serv5946/runtime/System/Reflection
Modified Files:
Assembly.cs AssemblyName.cs Module.cs TypeDelegator.cs
Log Message:
Signature-compatibility fixes to a large number of classes.
Index: Assembly.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/Assembly.cs,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** Assembly.cs 25 Apr 2003 01:26:17 -0000 1.25
--- Assembly.cs 25 Apr 2003 03:53:07 -0000 1.26
***************
*** 37,46 ****
[ClassInterface(ClassInterfaceType.AutoDual)]
#endif
! public class Assembly : IClrProgramItem, IEvidenceFactory
#if CONFIG_REFLECTION
, ICustomAttributeProvider
#endif
#if !ECMA_COMPAT
! , ISerializable
#endif
{
--- 37,46 ----
[ClassInterface(ClassInterfaceType.AutoDual)]
#endif
! public class Assembly : IClrProgramItem
#if CONFIG_REFLECTION
, ICustomAttributeProvider
#endif
#if !ECMA_COMPAT
! , ISerializable, IEvidenceFactory
#endif
{
Index: AssemblyName.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/AssemblyName.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** AssemblyName.cs 20 Dec 2001 10:11:39 -0000 1.2
--- AssemblyName.cs 25 Apr 2003 03:53:07 -0000 1.3
***************
*** 3,7 ****
* "System.Reflection.AssemblyName" class.
*
! * Copyright (C) 2001 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
--- 3,7 ----
* "System.Reflection.AssemblyName" class.
*
! * Copyright (C) 2001, 2003 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
***************
*** 28,34 ****
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Configuration.Assemblies;
! public class AssemblyName : ICloneable
{
// Internal state.
--- 28,36 ----
using System.Globalization;
using System.Runtime.CompilerServices;
+ using System.Runtime.Serialization;
using System.Configuration.Assemblies;
! public sealed class AssemblyName
! : ICloneable, ISerializable, IDeserializationCallback
{
// Internal state.
***************
*** 46,49 ****
--- 48,57 ----
// Constructor.
public AssemblyName() {}
+ [TODO]
+ internal AssemblyName(SerializationInfo info,
+ StreamingContext context)
+ {
+ // TODO
+ }
// Get the assembly name for a specific file.
***************
*** 56,60 ****
// Get or set the code base for the assembly name.
! public virtual String CodeBase
{
get
--- 64,68 ----
// Get or set the code base for the assembly name.
! public String CodeBase
{
get
***************
*** 69,73 ****
// Get or set the culture associated with the assembly name.
! public virtual CultureInfo CultureInfo
{
get
--- 77,81 ----
// Get or set the culture associated with the assembly name.
! public CultureInfo CultureInfo
{
get
***************
*** 81,86 ****
}
// Get or set the assembly name flags.
! public virtual AssemblyNameFlags Flags
{
get
--- 89,105 ----
}
+ // Get the escaped code base for the assembly name.
+ [TODO]
+ public String EscapedCodeBase
+ {
+ get
+ {
+ // TODO
+ return codeBase;
+ }
+ }
+
// Get or set the assembly name flags.
! public AssemblyNameFlags Flags
{
get
***************
*** 96,100 ****
// Get the full name of the assembly.
[TODO]
! public virtual String FullName
{
get
--- 115,119 ----
// Get the full name of the assembly.
[TODO]
! public String FullName
{
get
***************
*** 106,110 ****
// Get or set the hash algorithm for this assembly name.
! public virtual AssemblyHashAlgorithm HashAlgorithm
{
get
--- 125,129 ----
// Get or set the hash algorithm for this assembly name.
! public AssemblyHashAlgorithm HashAlgorithm
{
get
***************
*** 119,123 ****
// Get or set the key pair for this assembly name.
! public virtual StrongNameKeyPair KeyPair
{
get
--- 138,142 ----
// Get or set the key pair for this assembly name.
! public StrongNameKeyPair KeyPair
{
get
***************
*** 132,136 ****
// Get or set the simple name of the assembly name.
! public virtual String Name
{
get
--- 151,155 ----
// Get or set the simple name of the assembly name.
! public String Name
{
get
***************
*** 145,149 ****
// Get or set the version information of the assembly name.
! public virtual Version Version
{
get
--- 164,168 ----
// Get or set the version information of the assembly name.
! public Version Version
{
get
***************
*** 158,162 ****
// Get or set the version compatibility value for the assembly name.
! public virtual AssemblyVersionCompatibility VersionCompatibility
{
get
--- 177,181 ----
// Get or set the version compatibility value for the assembly name.
! public AssemblyVersionCompatibility VersionCompatibility
{
get
***************
*** 171,175 ****
// Clone this object.
! public virtual Object Clone()
{
return MemberwiseClone();
--- 190,194 ----
// Clone this object.
! public Object Clone()
{
return MemberwiseClone();
***************
*** 204,207 ****
--- 223,243 ----
{
return FullName;
+ }
+
+ // Get the serialization data for this object.
+ [TODO]
+ public void GetObjectData(SerializationInfo info, StreamingContext
context)
+ {
+ if(info == null)
+ {
+ throw new ArgumentNullException("info");
+ }
+ // TODO
+ }
+
+ // Handle a deserialization callback on this object.
+ public void OnDeserialization(Object sender)
+ {
+ // Nothing to do here.
}
Index: Module.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/Module.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** Module.cs 15 Apr 2003 11:22:32 -0000 1.9
--- Module.cs 25 Apr 2003 03:53:07 -0000 1.10
***************
*** 25,32 ****
--- 25,38 ----
using System;
+ using System.Collections;
using System.Globalization;
using System.Runtime.CompilerServices;
+ using System.Runtime.Serialization;
+ using System.Security.Cryptography.X509Certificates;
public class Module : IClrProgramItem, ICustomAttributeProvider
+ #if !ECMA_COMPAT
+ , ISerializable
+ #endif
{
// Internal state.
***************
*** 56,59 ****
--- 62,67 ----
// Get all module type fields that match a specific set of criteria.
+ // Note: the first is required by ECMA, but doesn't exist in the SDK,
+ // so you should avoid using it if at all possible.
public FieldInfo[] GetFields(BindingFlags bindingAttr)
{
***************
*** 104,107 ****
--- 112,117 ----
// Get all module type methods that match a specific set of criteria.
+ // Note: the first is required by ECMA, but doesn't exist in the SDK,
+ // so you should avoid using it if at all possible.
public MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
***************
*** 151,155 ****
// Get the scope name for this module.
! public virtual String ScopeName
{
get
--- 161,165 ----
// Get the scope name for this module.
! public String ScopeName
{
get
***************
*** 160,168 ****
// Get custom attributes for this module.
! public Object[] GetCustomAttributes(bool inherit)
{
return ClrHelpers.GetCustomAttributes(this,
inherit);
}
! public Object[] GetCustomAttributes(Type type, bool inherit)
{
return ClrHelpers.GetCustomAttributes(this,
type, inherit);
--- 170,178 ----
// Get custom attributes for this module.
! public virtual Object[] GetCustomAttributes(bool inherit)
{
return ClrHelpers.GetCustomAttributes(this,
inherit);
}
! public virtual Object[] GetCustomAttributes(Type type, bool inherit)
{
return ClrHelpers.GetCustomAttributes(this,
type, inherit);
***************
*** 170,174 ****
// Determine if a custom attribute is defined for this module.
! public bool IsDefined(Type type, bool inherit)
{
return ClrHelpers.IsDefined(this, type,
inherit);
--- 180,184 ----
// Determine if a custom attribute is defined for this module.
! public virtual bool IsDefined(Type type, bool inherit)
{
return ClrHelpers.IsDefined(this, type,
inherit);
***************
*** 195,198 ****
--- 205,299 ----
[MethodImpl(MethodImplOptions.InternalCall)]
extern public bool IsResource();
+
+ // Get the signer certificate for this module.
+ public X509Certificate GetSignerCertificate()
+ {
+ // Not used in this implementation.
+ return null;
+ }
+
+ // Get the serialization data for this module.
+ [TODO]
+ public virtual void GetObjectData(SerializationInfo info,
+
StreamingContext context)
+ {
+ if(info == null)
+ {
+ throw new ArgumentNullException("info");
+ }
+ // TODO
+ }
+
+ // A type filter that searches on name.
+ private static bool FilterTypeNameImpl(Type type, Object criteria)
+ {
+ String name = (criteria as String);
+ if(name != null)
+ {
+ if(name.EndsWith("*"))
+ {
+ return type.FullName.StartsWith
+ (name.Substring(0,
name.Length - 1));
+ }
+ else
+ {
+ return (type.FullName == name);
+ }
+ }
+ return false;
+ }
+
+ // A type filter that searches on name while ignoring case.
+ private static bool FilterTypeNameIgnoreCaseImpl
+ (Type type, Object criteria)
+ {
+ String name = (criteria as String);
+ if(name != null)
+ {
+ if(name.EndsWith("*"))
+ {
+ name = name.Substring(0,
name.Length - 1);
+ String fullName = type.FullName;
+ if(fullName.Length <
name.Length)
+ {
+ return false;
+ }
+ return
(String.Compare(fullName, 0, name, 0,
+
name.Length, true) == 0);
+ }
+ else
+ {
+ return
(String.Compare(type.FullName, name, true)
+ == 0);
+ }
+ }
+ return false;
+ }
+
+ // Declare the standard type filters.
+ public static readonly TypeFilter FilterTypeName =
+ new TypeFilter(FilterTypeNameImpl);
+ public static readonly TypeFilter FilterTypeNameIgnoreCase =
+ new TypeFilter(FilterTypeNameIgnoreCaseImpl);
+
+ // Find all types that match a specified filter criteria.
+ public virtual Type[] FindTypes(TypeFilter filter,
+ Object
filterCriteria)
+ {
+ Type[] types = GetTypes();
+ if(filter == null || types == null)
+ {
+ return types;
+ }
+ ArrayList list = new ArrayList();
+ foreach(Type type in types)
+ {
+ if(filter(type, filterCriteria))
+ {
+ list.Add(type);
+ }
+ }
+ return (Type[])(list.ToArray(typeof(Type)));
+ }
#else // ECMA_COMPAT
Index: TypeDelegator.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Reflection/TypeDelegator.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** TypeDelegator.cs 19 Apr 2003 04:03:04 -0000 1.1
--- TypeDelegator.cs 25 Apr 2003 03:53:07 -0000 1.2
***************
*** 86,89 ****
--- 86,95 ----
}
+ // Implementation of the "IsValueType" property.
+ protected override bool IsValueTypeImpl()
+ {
+ return typeImpl.IsValueTypeImpl();
+ }
+
// General properties.
public override String AssemblyQualifiedName
***************
*** 175,178 ****
--- 181,189 ----
return typeImpl.GetEvents(bindingAttr);
}
+ public override EventInfo[] GetEvents()
+ {
+ return typeImpl.GetEvents();
+ }
+
// Get a field from this type.
***************
*** 280,295 ****
}
- // Implementation of the "IsContextful" property.
- protected override bool IsContextfulImpl()
- {
- return typeImpl.IsContextful;
- }
-
- // Implementation of the "IsMarshalByRef" property.
- protected override bool IsMarshalByRefImpl()
- {
- return typeImpl.IsMarshalByRef;
- }
-
// Implement overridden properties.
public override Guid GUID
--- 291,294 ----
***************
*** 326,343 ****
{
return typeImpl.UnderlyingSystemType;
- }
- }
- public override Type DeclaringType
- {
- get
- {
- return typeImpl.DeclaringType;
- }
- }
- public override Type ReflectedType
- {
- get
- {
- return typeImpl.ReflectedType;
}
}
--- 325,328 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Reflection Assembly.cs,1.25,1.26 AssemblyName.cs,1.2,1.3 Module.cs,1.9,1.10 TypeDelegator.cs,1.1,1.2,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security SecurityException.cs,1.5,1.6 SecurityManager.cs,1.3,1.4
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security/Policy CodeGroup.cs,1.1,1.2 FileCodeGroup.cs,1.1,1.2 PolicyLevel.cs,1.2,1.3
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security SecurityException.cs,1.5,1.6 SecurityManager.cs,1.3,1.4
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Security/Policy CodeGroup.cs,1.1,1.2 FileCodeGroup.cs,1.1,1.2 PolicyLevel.cs,1.2,1.3
- Index(es):