Esempio n. 1
0
        internal static MrAssembly CreateFakeAssembly(string name, MrLoadContext loadContext)
        {
            var mrAssembly = new MrAssembly(null, null, loadContext);

            mrAssembly.IsFakeAssembly = true;
            mrAssembly.Name           = name;
            return(mrAssembly);
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            var other  = obj as MrAssembly;
            var prolog = MrLoadContext.OverrideEqualsProlog(this, other);

            if (prolog != null)
            {
                return((bool)prolog);
            }

            return(this.Reader == other.Reader);
        }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            var other  = obj as MrProperty;
            var prolog = MrLoadContext.OverrideEqualsProlog(this, other);

            if (prolog != null)
            {
                return((bool)prolog);
            }

            return(this.DeclaringType == other.DeclaringType &&
                   this.DefinitionHandle == other.DefinitionHandle);
        }
Esempio n. 4
0
        public override bool Equals(object obj)
        {
            var other  = obj as MrParameter;
            var prolog = MrLoadContext.OverrideEqualsProlog(this, other);

            if (prolog != null)
            {
                return((bool)prolog);
            }

            var matches =
                this.Method == other.Method &&
                this._parameterHandle == other._parameterHandle;

            return(matches);
        }
        public override bool Equals(object obj)
        {
            var other  = obj as MrEvent;
            var prolog = MrLoadContext.OverrideEqualsProlog(this, other);

            if (prolog != null)
            {
                return((bool)prolog);
            }

            if (this.DeclaringType != other.DeclaringType ||
                this.DefinitionHandle != other.DefinitionHandle)
            {
                return(false);
            }

            return(true);
        }
        public override bool Equals(object obj)
        {
            var other  = obj as MrType;
            var prolog = MrLoadContext.OverrideEqualsProlog(this, other);

            if (prolog != null)
            {
                return((bool)prolog);
            }

            // Skip TypeDefinition because it doesn't support Equals, and it's generated from the
            // TypeDefinitionHandle anyway
            bool matches =
                this.Assembly == other.Assembly &&
                this.TypeCode == other.TypeCode &&
                this.IsTypeCode == other.IsTypeCode &&
                this.TypeDefinitionHandle == other.TypeDefinitionHandle &&
                this.GenericParameterHandle == other.GenericParameterHandle &&
                this._fakeName == other._fakeName &&
                this._fakeNamespace == other._fakeNamespace;

            if (!matches)
            {
                return(false);
            }

            if (this._typeArguments != null)
            {
                if (other._typeArguments == null)
                {
                    return(false);
                }

                for (int i = 0; i < _typeArguments.Length; i++)
                {
                    if (this._typeArguments[i] != other._typeArguments[i])
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Esempio n. 7
0
        static public MrAssembly Create(MetadataReader reader, string location, MrLoadContext loadContext)
        {
            var mrAssembly = new MrAssembly(reader, location, loadContext);

            return(mrAssembly);
        }
Esempio n. 8
0
 public static bool operator ==(MrAssembly operand1, MrAssembly operand2)
 {
     return(MrLoadContext.OperatorEquals(operand1, operand2));
 }
Esempio n. 9
0
 private MrAssembly(MetadataReader reader, string location, MrLoadContext loadContext)
 {
     this.Location     = location;
     this.Reader       = reader;
     this._loadContext = loadContext;
 }
Esempio n. 10
0
 public static bool operator ==(MrParameter operand1, MrParameter operand2)
 {
     return(MrLoadContext.OperatorEquals(operand1, operand2));
 }
Esempio n. 11
0
 MrAssembly(MrLoadContext loadContext)
 {
     _loadContext = loadContext;
 }