コード例 #1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public InterfacesCollection(NetTypeDefinition owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     this.owner = owner;
 }
コード例 #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);
 }
コード例 #3
0
            /// <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);
                }
            }
コード例 #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));
 }
コード例 #5
0
 protected override void CreateNestedTypes(ClassFile cf, Model.NetTypeDefinition declaringType, string parentFullName, Model.NetModule module, TargetFramework target)
 {
     // Do nothing
 }
コード例 #6
0
 protected override void RegisterType(TargetFramework target, ClassFile classFile, Model.NetTypeDefinition typeDef)
 {
     // Do nothing
 }
コード例 #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)));
 }
コード例 #8
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public NetGenericInstanceType(NetTypeDefinition elementType, NetTypeReference declaringType)
 {
     this.elementType   = elementType;
     this.declaringType = declaringType;
 }
コード例 #9
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public NetMemberDefinitionCollection(NetTypeDefinition declaringType)
 {
     this.declaringType = declaringType;
 }