Ejemplo n.º 1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public InterfacesCollection(NetTypeDefinition owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     this.owner = owner;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public NetMethodDefinition(string name, JvmClassLib.MethodDefinition javaMethod, NetTypeDefinition declaringType, TargetFramework target, SignedByteMode signMode, string createReason)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (declaringType == null)
     {
         throw new ArgumentNullException("declaringType");
     }
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     Name              = name;
     DeclaringType     = declaringType;
     this.javaMethod   = javaMethod; // Can be null
     this.target       = target;
     this.signMode     = signMode;
     this.createReason = createReason;
     overrides         = new OverrideCollection(this);
 }
            /// <summary>
            /// Add all methods from type that owner overrides to the given list.
            /// </summary>
            private void AddOverrides(NetTypeDefinition type, HashSet <NetMethodDefinition> target, HashSet <NetTypeDefinition> visitedTypes)
            {
                // Add the method(s) that my owner overrides
                if (owner.DeclaringType != type)
                {
                    visitedTypes.Add(type);
                    foreach (var m in type.Methods.Where(IsOverride))
                    {
                        target.Add(m);
                        foreach (var o in m.Overrides)
                        {
                            target.Add(o);
                        }
                    }
                }

                // Add interface method(s) that my owner overrides
                foreach (var intf in type.Interfaces.Select(x => x.GetElementType()))
                {
                    foreach (var m in intf.Methods.Where(IsOverride))
                    {
                        target.Add(m);
                        foreach (var o in m.Overrides)
                        {
                            target.Add(o);
                        }
                    }

                    // Recurse
                    AddOverrides(intf, target, visitedTypes);
                }

                // Recurse into base type
                if (type.BaseType != null)
                {
                    AddOverrides(type.BaseType.GetElementType(), target, visitedTypes);
                }
            }
Ejemplo n.º 4
0
 /// <summary>
 /// Are this member an the given type definition in the same scope?
 /// </summary>
 public bool HasSameScope(NetTypeDefinition other)
 {
     return((other != null) && (scope == other.scope));
 }
 protected override void CreateNestedTypes(ClassFile cf, Model.NetTypeDefinition declaringType, string parentFullName, Model.NetModule module, TargetFramework target)
 {
     // Do nothing
 }
 protected override void RegisterType(TargetFramework target, ClassFile classFile, Model.NetTypeDefinition typeDef)
 {
     // Do nothing
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Are this member an the given type definition in the same scope?
 /// </summary>
 public bool HasSameScope(NetTypeDefinition type)
 {
     return((DeclaringType != null) && (DeclaringType.HasSameScope(type)));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public NetGenericInstanceType(NetTypeDefinition elementType, NetTypeReference declaringType)
 {
     this.elementType   = elementType;
     this.declaringType = declaringType;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public NetMemberDefinitionCollection(NetTypeDefinition declaringType)
 {
     this.declaringType = declaringType;
 }