PageRenderTime 19ms CodeModel.GetById 10ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/Mono.Cecil/MethodSpecification.cs

http://github.com/jbevain/cecil
C# | 84 lines | 56 code | 19 blank | 9 comment | 0 complexity | 502158422ed9899a6c4801eae0a3f82b MD5 | raw file
 1//
 2// Author:
 3//   Jb Evain (jbevain@gmail.com)
 4//
 5// Copyright (c) 2008 - 2015 Jb Evain
 6// Copyright (c) 2008 - 2011 Novell, Inc.
 7//
 8// Licensed under the MIT/X11 license.
 9//
10
11using System;
12
13using Mono.Collections.Generic;
14
15namespace Mono.Cecil {
16
17	public abstract class MethodSpecification : MethodReference {
18
19		readonly MethodReference method;
20
21		public MethodReference ElementMethod {
22			get { return method; }
23		}
24
25		public override string Name {
26			get { return method.Name; }
27			set { throw new InvalidOperationException (); }
28		}
29
30		public override MethodCallingConvention CallingConvention {
31			get { return method.CallingConvention; }
32			set { throw new InvalidOperationException (); }
33		}
34
35		public override bool HasThis {
36			get { return method.HasThis; }
37			set { throw new InvalidOperationException (); }
38		}
39
40		public override bool ExplicitThis {
41			get { return method.ExplicitThis; }
42			set { throw new InvalidOperationException (); }
43		}
44
45		public override MethodReturnType MethodReturnType {
46			get { return method.MethodReturnType; }
47			set { throw new InvalidOperationException (); }
48		}
49
50		public override TypeReference DeclaringType {
51			get { return method.DeclaringType; }
52			set { throw new InvalidOperationException (); }
53		}
54
55		public override ModuleDefinition Module {
56			get { return method.Module; }
57		}
58
59		public override bool HasParameters {
60			get { return method.HasParameters; }
61		}
62
63		public override Collection<ParameterDefinition> Parameters {
64			get { return method.Parameters; }
65		}
66
67		public override bool ContainsGenericParameter {
68			get { return method.ContainsGenericParameter; }
69		}
70
71		internal MethodSpecification (MethodReference method)
72		{
73			Mixin.CheckMethod (method);
74
75			this.method = method;
76			this.token = new MetadataToken (TokenType.MethodSpec);
77		}
78
79		public sealed override MethodReference GetElementMethod ()
80		{
81			return method.GetElementMethod ();
82		}
83	}
84}