Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #7
0
        static public MrAssembly Create(MetadataReader reader, string location, MrLoadContext loadContext)
        {
            var mrAssembly = new MrAssembly(reader, location, loadContext);

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