diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2008-08-08 21:44:19 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2008-08-08 21:44:19 +0400 |
commit | 3c9a0b2d17cf843a534a57287f0cecaaf55997a1 (patch) | |
tree | bf812cf3ff6b07eae518b06640fc169404ae1920 /gui-compare/CecilMetadata.cs | |
parent | 7499cff4fd10d345d5022e7b71ab26798c8206e9 (diff) |
2008-08-08 Sebastien Pouliot <sebastien@ximian.com>
* CecilMetadata.cs: Don't recurse on BaseType when looking at
interfaces, otherwise we end up with a lot of extras (compared to
the XML definition). Process private methods that are implementing
an explicit interface requirement. Add NotSerialized to the
FieldAttributes mask.
* MasterMetadata.cs: Add NonSerializedAttribute to ShouldSkipAttribute
since this pseudo-attribute is part of the XML definition. Add
FamORAssem checks (replace by Family) since this introduce false
errors in the reports (we don't care about the internal/assembly part)
* Masterinfo.cs: Fix bad check with FamORAssem that turned private
stuff into Family.
svn path=/trunk/mono-tools/; revision=110001
Diffstat (limited to 'gui-compare/CecilMetadata.cs')
-rw-r--r-- | gui-compare/CecilMetadata.cs | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/gui-compare/CecilMetadata.cs b/gui-compare/CecilMetadata.cs index 4e84a8d2..af782689 100644 --- a/gui-compare/CecilMetadata.cs +++ b/gui-compare/CecilMetadata.cs @@ -73,31 +73,14 @@ namespace GuiCompare { List<CompNamed> event_list) { if (interface_list != null) { - TypeDefinition td = fromDef; - TypeReference fromRef; - - do { - foreach (TypeReference ifc in td.Interfaces) { - TypeDefinition ifc_def = CecilUtils.Resolver.Resolve (ifc); - if (ifc_def.IsNotPublic) - continue; - - CecilInterface new_ifc = new CecilInterface (ifc); - bool found = false; - for (int i = 0; i < interface_list.Count; i ++) { - if (interface_list[i].Name == new_ifc.Name) { - found = true; - break; - } - } - if (!found) - interface_list.Add (new_ifc); - } - fromRef = td.BaseType; - if (fromRef != null) - td = CecilUtils.Resolver.Resolve (fromRef); - } while (fromRef != null); + foreach (TypeReference ifc in fromDef.Interfaces) { + TypeDefinition ifc_def = CecilUtils.Resolver.Resolve (ifc); + if (ifc_def.IsNotPublic) + continue; + interface_list.Add (new CecilInterface (ifc)); + } } + if (constructor_list != null) { foreach (MethodDefinition md in fromDef.Constructors) { if (md.IsPrivate || md.IsAssembly) @@ -111,8 +94,13 @@ namespace GuiCompare { if (!md.Name.StartsWith("op_")) continue; } - if (md.IsPrivate || md.IsAssembly) + if (md.IsAssembly) continue; + // don't exclude private methods that implements explicit interfaces + // note: this also adds explicit implementation of *private* interfaces (should be rare) + if (md.IsPrivate && md.Name.IndexOf ('.') < 0) + continue; + method_list.Add (new CecilMethod (md)); } } @@ -652,7 +640,8 @@ namespace GuiCompare { FieldAttributes.InitOnly | FieldAttributes.Literal | FieldAttributes.HasDefault | - FieldAttributes.HasFieldMarshal); + FieldAttributes.HasFieldMarshal | + FieldAttributes.NotSerialized ); public override string GetMemberAccess () { FieldAttributes fa = field_def.Attributes & masterInfoFieldMask; @@ -929,4 +918,4 @@ namespace GuiCompare { CustomAttribute ca; } -}
\ No newline at end of file +} |