3 using System.Reflection;
4 using System.Collections;
6 namespace Mono.Util.CorCompare
10 /// Represents a generic member that is completely missing
13 /// created by - Piersh
14 /// created on - 3/1/2002 3:37:00 am
16 abstract class MissingMember : MissingBase
18 // e.g. <method name="Equals" status="missing"/>
19 protected MemberInfo mInfoMono;
20 protected MemberInfo mInfoMS;
21 protected CompletionTypes completion = CompletionTypes.Missing;
22 protected ArrayList rgAttributes;
23 protected CompletionInfo ci;
25 public MissingMember (MemberInfo infoMono, MemberInfo infoMS)
29 completion = (infoMono == null) ? CompletionTypes.Missing : CompletionTypes.Complete;
32 public override string Name
34 get { return Info.Name; }
37 public override CompletionTypes Completion
39 get { return completion; }
43 /// returns the MemberInfo for this member.
44 /// if it's a missing member then the microsoft MemberInfo is returned instead
46 public MemberInfo Info
48 get { return (mInfoMono != null) ? mInfoMono : mInfoMS; }
52 /// returns the 'best' info for this member. the 'best' info is the microsoft info, if it's available, otherwise the mono info.
54 public MemberInfo BestInfo
56 get { return (mInfoMS != null) ? mInfoMS : mInfoMono; }
59 public override XmlElement CreateXML (XmlDocument doc)
61 XmlElement eltMissing = base.CreateXML (doc);
63 XmlElement eltAttributes = MissingBase.CreateMemberCollectionElement ("attributes", rgAttributes, ci, doc);
64 if (eltAttributes != null)
65 eltMissing.AppendChild (eltAttributes);
70 public virtual CompletionInfo Analyze ()
72 if (mInfoMono == null)
74 completion = CompletionTypes.Missing;
78 rgAttributes = new ArrayList ();
79 ci = MissingAttribute.AnalyzeAttributes (
80 (mInfoMono == null) ? null : mInfoMono.GetCustomAttributes (false),
81 (mInfoMS == null) ? null : mInfoMS.GetCustomAttributes (false),
84 if (ci.cTodo != 0 || ci.cMissing != 0)
85 completion = CompletionTypes.Todo;
87 completion = CompletionTypes.Complete;