~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to contrib/Mono.Cecil/Mono.Cecil/Mono.Cecil/IMemberDefinition.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

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
 
// (C) 2005 Jb Evain
 
7
// Copyright (c) 2008 - 2010 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
28
28
 
29
29
namespace Mono.Cecil {
30
30
 
31
 
        public interface IMemberDefinition : IMemberReference, ICustomAttributeProvider {
32
 
 
33
 
                new TypeDefinition DeclaringType { get; set; }
 
31
        public interface IMemberDefinition : ICustomAttributeProvider {
 
32
 
 
33
                string Name { get; set; }
 
34
                string FullName { get; }
 
35
 
34
36
                bool IsSpecialName { get; set; }
35
37
                bool IsRuntimeSpecialName { get; set; }
 
38
 
 
39
                TypeDefinition DeclaringType { get; set; }
 
40
        }
 
41
 
 
42
        static partial class Mixin {
 
43
 
 
44
                public static bool GetAttributes (this uint self, uint attributes)
 
45
                {
 
46
                        return (self & attributes) != 0;
 
47
                }
 
48
 
 
49
                public static uint SetAttributes (this uint self, uint attributes, bool value)
 
50
                {
 
51
                        if (value)
 
52
                                return self | attributes;
 
53
 
 
54
                        return self & ~attributes;
 
55
                }
 
56
 
 
57
                public static bool GetMaskedAttributes (this uint self, uint mask, uint attributes)
 
58
                {
 
59
                        return (self & mask) == attributes;
 
60
                }
 
61
 
 
62
                public static uint SetMaskedAttributes (this uint self, uint mask, uint attributes, bool value)
 
63
                {
 
64
                        if (value) {
 
65
                                self &= ~mask;
 
66
                                return self | attributes;
 
67
                        }
 
68
 
 
69
                        return self & ~(mask & attributes);
 
70
                }
 
71
 
 
72
                public static bool GetAttributes (this ushort self, ushort attributes)
 
73
                {
 
74
                        return (self & attributes) != 0;
 
75
                }
 
76
 
 
77
                public static ushort SetAttributes (this ushort self, ushort attributes, bool value)
 
78
                {
 
79
                        if (value)
 
80
                                return (ushort) (self | attributes);
 
81
 
 
82
                        return (ushort) (self & ~attributes);
 
83
                }
 
84
 
 
85
                public static bool GetMaskedAttributes (this ushort self, ushort mask, uint attributes)
 
86
                {
 
87
                        return (self & mask) == attributes;
 
88
                }
 
89
 
 
90
                public static ushort SetMaskedAttributes (this ushort self, ushort mask, uint attributes, bool value)
 
91
                {
 
92
                        if (value) {
 
93
                                self = (ushort) (self & ~mask);
 
94
                                return (ushort) (self | attributes);
 
95
                        }
 
96
 
 
97
                        return (ushort) (self & ~(mask & attributes));
 
98
                }
36
99
        }
37
100
}