projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New tests.
[mono.git]
/
mcs
/
class
/
corlib
/
System
/
MulticastDelegate.cs
diff --git
a/mcs/class/corlib/System/MulticastDelegate.cs
b/mcs/class/corlib/System/MulticastDelegate.cs
index a87f9ad768c54f5a5fb6772c18cdf372a0ceb30e..df7becdea425ed5e4c8ae7e0deabf29e4f4ad6e8 100644
(file)
--- a/
mcs/class/corlib/System/MulticastDelegate.cs
+++ b/
mcs/class/corlib/System/MulticastDelegate.cs
@@
-36,6
+36,8
@@
using System.Runtime.Serialization;
namespace System
{
namespace System
{
+ [System.Runtime.InteropServices.ComVisible (true)]
+ [Serializable]
public abstract class MulticastDelegate : Delegate
{
private MulticastDelegate prev;
public abstract class MulticastDelegate : Delegate
{
private MulticastDelegate prev;
@@
-47,8
+49,8
@@
namespace System
prev = null;
}
prev = null;
}
- protected MulticastDelegate (Type target
_type
, string method)
- : base (target
_type
, method)
+ protected MulticastDelegate (Type target, string method)
+ : base (target, method)
{
prev = null;
}
{
prev = null;
}
@@
-67,17
+69,22
@@
namespace System
return base.DynamicInvokeImpl (args);
}
return base.DynamicInvokeImpl (args);
}
+ internal bool HasSingleTarget {
+ get { return prev == null; }
+ }
// <remarks>
// Equals: two multicast delegates are equal if their base is equal
// and their invocations list is equal.
// </remarks>
// <remarks>
// Equals: two multicast delegates are equal if their base is equal
// and their invocations list is equal.
// </remarks>
- public sealed override bool Equals (object o)
+ public sealed override bool Equals (object o
bj
)
{
{
- if (!base.Equals (o))
+ if (!base.Equals (o
bj
))
return false;
return false;
- MulticastDelegate d = (MulticastDelegate) o;
-
+ MulticastDelegate d = obj as MulticastDelegate;
+ if (d == null)
+ return false;
+
if (this.prev == null) {
if (d.prev == null)
return true;
if (this.prev == null) {
if (d.prev == null)
return true;
@@
-139,6
+146,7
@@
namespace System
throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types."));
combined = (MulticastDelegate)follow.Clone ();
throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types."));
combined = (MulticastDelegate)follow.Clone ();
+ combined.SetMulticastInvoke ();
for (clone = combined, orig = ((MulticastDelegate)follow).prev; orig != null; orig = orig.prev) {
for (clone = combined, orig = ((MulticastDelegate)follow).prev; orig != null; orig = orig.prev) {
@@
-253,19
+261,20
@@
namespace System
return retval;
}
return retval;
}
- public static bool operator == (MulticastDelegate
a, MulticastDelegate b
)
+ public static bool operator == (MulticastDelegate
d1, MulticastDelegate d2
)
{
{
- if ((object)a == null) {
- if ((object)b == null)
- return true;
- return false;
- }
- return a.Equals (b);
+ if (d1 == null)
+ return d2 == null;
+
+ return d1.Equals (d2);
}
}
- public static bool operator != (MulticastDelegate
a, MulticastDelegate b
)
+ public static bool operator != (MulticastDelegate
d1, MulticastDelegate d2
)
{
{
- return !(a == b);
+ if (d1 == null)
+ return d2 != null;
+
+ return !d1.Equals (d2);
}
}
}
}
}
}