~ubuntu-branches/ubuntu/utopic/monodevelop/utopic

« back to all changes in this revision

Viewing changes to external/mono-addins/Mono.Addins.CecilReflector/Mono.Cecil/Mono.Cecil/CallSite.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-10-10 14:50:04 UTC
  • mfrom: (10.3.4)
  • Revision ID: package-import@ubuntu.com-20131010145004-80l130sny21b17sb
Tags: 4.0.12+dfsg-1
* [5dcb6e1] Fix debian/watch for new source tarball name format
* [5c68cb5] Refresh list of files removed by get-orig-source to 
  reflect 4.0.12
* [96d60a0] Imported Upstream version 4.0.12+dfsg
* [b989752] Refresh debian/patches/no_appmenu to ensure it applies
* [2a4c351] Ensure every assembly in external/ is cleaned properly
* [92762f7] Add more excluded Mac-specific modulerefs
* [bc698ba] Add symlinks to NUnit assemblies (Closes: #714246)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
// Author:
5
5
//   Jb Evain (jbevain@gmail.com)
6
6
//
7
 
// Copyright (c) 2008 - 2010 Jb Evain
 
7
// Copyright (c) 2008 - 2011 Jb Evain
8
8
//
9
9
// Permission is hereby granted, free of charge, to any person obtaining
10
10
// a copy of this software and associated documentation files (the
29
29
using System;
30
30
using System.Text;
31
31
 
 
32
using Mono.Collections.Generic;
 
33
 
32
34
namespace Mono.Cecil {
33
35
 
34
 
        public sealed class CallSite : MethodReference {
35
 
 
36
 
                public override string FullName {
 
36
        public sealed class CallSite : IMethodSignature {
 
37
 
 
38
                readonly MethodReference signature;
 
39
 
 
40
                public bool HasThis {
 
41
                        get { return signature.HasThis; }
 
42
                        set { signature.HasThis = value; }
 
43
                }
 
44
 
 
45
                public bool ExplicitThis {
 
46
                        get { return signature.ExplicitThis; }
 
47
                        set { signature.ExplicitThis = value; }
 
48
                }
 
49
 
 
50
                public MethodCallingConvention CallingConvention {
 
51
                        get { return signature.CallingConvention; }
 
52
                        set { signature.CallingConvention = value; }
 
53
                }
 
54
 
 
55
                public bool HasParameters {
 
56
                        get { return signature.HasParameters; }
 
57
                }
 
58
 
 
59
                public Collection<ParameterDefinition> Parameters {
 
60
                        get { return signature.Parameters; }
 
61
                }
 
62
 
 
63
                public TypeReference ReturnType {
 
64
                        get { return signature.MethodReturnType.ReturnType; }
 
65
                        set { signature.MethodReturnType.ReturnType = value; }
 
66
                }
 
67
 
 
68
                public MethodReturnType MethodReturnType {
 
69
                        get { return signature.MethodReturnType; }
 
70
                }
 
71
 
 
72
                public string Name {
 
73
                        get { return string.Empty; }
 
74
                        set { throw new InvalidOperationException (); }
 
75
                }
 
76
 
 
77
                public string Namespace {
 
78
                        get { return string.Empty; }
 
79
                        set { throw new InvalidOperationException (); }
 
80
                }
 
81
 
 
82
                public ModuleDefinition Module {
 
83
                        get { return ReturnType.Module; }
 
84
                }
 
85
 
 
86
                public IMetadataScope Scope {
 
87
                        get { return signature.ReturnType.Scope; }
 
88
                }
 
89
 
 
90
                public MetadataToken MetadataToken {
 
91
                        get { return signature.token; }
 
92
                        set { signature.token = value; }
 
93
                }
 
94
 
 
95
                public string FullName {
37
96
                        get {
38
97
                                var signature = new StringBuilder ();
39
98
                                signature.Append (ReturnType.FullName);
41
100
                                return signature.ToString ();
42
101
                        }
43
102
                }
 
103
 
 
104
                internal CallSite ()
 
105
                {
 
106
                        this.signature = new MethodReference ();
 
107
                        this.signature.token = new MetadataToken (TokenType.Signature, 0);
 
108
                }
 
109
 
 
110
                public CallSite (TypeReference returnType)
 
111
                        : this ()
 
112
                {
 
113
                        if (returnType == null)
 
114
                                throw new ArgumentNullException ("returnType");
 
115
 
 
116
                        this.signature.ReturnType = returnType;
 
117
                }
 
118
 
 
119
                public override string ToString ()
 
120
                {
 
121
                        return FullName;
 
122
                }
44
123
        }
45
124
}