Mono.CSharp.MethodSpec.Mutate C# (CSharp) 메소드

Mutate() 공개 메소드

public Mutate ( Mono.CSharp.TypeParameterMutator mutator ) : MethodSpec
mutator Mono.CSharp.TypeParameterMutator
리턴 MethodSpec
        public MethodSpec Mutate(TypeParameterMutator mutator)
        {
            var targs = TypeArguments;
            if (targs != null)
                targs = mutator.Mutate (targs);

            var decl = DeclaringType;
            if (DeclaringType.IsGenericOrParentIsGeneric) {
                decl = mutator.Mutate (decl);
            }

            if (targs == TypeArguments && decl == DeclaringType)
                return this;

            var ms = (MethodSpec) MemberwiseClone ();
            if (decl != DeclaringType) {
                ms.inflatedMetaInfo = null;
                ms.declaringType = decl;
                ms.state |= StateFlags.PendingMetaInflate;
            }

            if (targs != null) {
                ms.targs = targs;
                ms.state |= StateFlags.PendingMakeMethod;
            }

            return ms;
        }

Usage Example

예제 #1
0
파일: codegen.cs 프로젝트: blinds52/mono
		public void Emit (OpCode opcode, MethodSpec method)
		{
			if (IsAnonymousStoreyMutateRequired)
				method = method.Mutate (CurrentAnonymousMethod.Storey.Mutator);

			if (method.IsConstructor)
				ig.Emit (opcode, (ConstructorInfo) method.GetMetaInfo ());
			else
				ig.Emit (opcode, (MethodInfo) method.GetMetaInfo ());
		}
All Usage Examples Of Mono.CSharp.MethodSpec::Mutate