1 // Mono.Util.CorCompare.MissingEvent
4 // Nick Drochak (ndrochak@gol.com)
6 // (C) 2001-2002 Nick Drochak
9 using System
.Reflection
;
12 namespace Mono
.Util
.CorCompare
{
15 /// Represents a class event that is completely missing
19 /// created on - 2/24/2002 10:43:57 PM
21 class MissingEvent
: MissingMember
{
22 // e.g. <method name="Equals" status="missing"/>
23 public MissingEvent (MemberInfo infoMono
, MemberInfo infoMS
) : base (infoMono
, infoMS
) {}
25 MissingMethod mmRemove
;
26 MissingMethod mmRaise
;
28 public override string Type
{
34 public override NodeStatus
Analyze ()
36 m_nodeStatus
= base.Analyze ();
38 EventInfo eiMono
= (EventInfo
) mInfoMono
;
39 EventInfo eiMS
= (EventInfo
) mInfoMS
;
41 MemberInfo miAddMono
, miRemoveMono
, miRaiseMono
;
43 miAddMono
= miRemoveMono
= miRaiseMono
= null;
46 miAddMono
= eiMono
.GetAddMethod ();
47 miRemoveMono
= eiMono
.GetRemoveMethod ();
48 miRaiseMono
= eiMono
.GetRaiseMethod ();
51 MemberInfo miAddMS
, miRemoveMS
, miRaiseMS
;
53 miAddMS
= miRemoveMS
= miRaiseMS
= null;
56 miAddMS
= eiMS
.GetAddMethod ();
57 miRemoveMS
= eiMS
.GetRemoveMethod ();
58 miRaiseMS
= eiMS
.GetRaiseMethod ();
61 if (miAddMono
!= null || miAddMS
!= null)
63 mmAdd
= new MissingMethod (miAddMono
, miAddMS
);
64 m_nodeStatus
.AddChildren (mmAdd
.Analyze ());
66 if (miRemoveMono
!= null || miRemoveMS
!= null)
68 mmRemove
= new MissingMethod (miRemoveMono
, miRemoveMS
);
69 m_nodeStatus
.AddChildren (mmRemove
.Analyze ());
71 if (miRaiseMono
!= null || miRaiseMS
!= null)
73 mmRaise
= new MissingMethod (miRemoveMono
, miRemoveMS
);
74 m_nodeStatus
.AddChildren (mmRaise
.Analyze ());
79 public override XmlElement
CreateXML (XmlDocument doc
)
81 XmlElement eltMember
= base.CreateXML (doc
);
83 if (mInfoMono
!= null && mmRaise
!= null)
85 XmlElement eltAccessors
= (XmlElement
) eltMember
.SelectSingleNode ("accessors");
86 if (eltAccessors
== null)
88 eltAccessors
= doc
.CreateElement ("accessors");
89 eltMember
.AppendChild (eltAccessors
);
93 XmlElement eltAdd
= mmAdd
.CreateXML (doc
);
94 eltAccessors
.AppendChild (eltAdd
);
98 XmlElement eltRemove
= mmRemove
.CreateXML (doc
);
99 eltAccessors
.AppendChild (eltRemove
);
103 XmlElement eltRaise
= mmRaise
.CreateXML (doc
);
104 eltAccessors
.AppendChild (eltRaise
);