This commit is contained in:
parent
49b5e96850
commit
d903852b37
4 changed files with 21 additions and 16 deletions
|
|
@ -495,6 +495,15 @@ namespace Server
|
|||
|
||||
public delegate void Callback();
|
||||
|
||||
#if MONO
|
||||
private static bool GenericComparator( Type type, object obj )
|
||||
{
|
||||
return ( type.IsGenericType )
|
||||
&& ( type.GetGenericTypeDefinition() == typeof( IComparable<> ) )
|
||||
&& ( type.GetGenericArguments()[0].IsAssignableFrom(obj as Type) );
|
||||
}
|
||||
#endif
|
||||
|
||||
public bool CompareTo( int sign, Callback argGenerator )
|
||||
{
|
||||
Type active = this.Active;
|
||||
|
|
@ -526,12 +535,16 @@ namespace Server
|
|||
* Bleh.
|
||||
*/
|
||||
|
||||
#if MONO
|
||||
Type[] ifaces = active.FindInterfaces( GenericComparator, active );
|
||||
#else
|
||||
Type[] ifaces = active.FindInterfaces( delegate( Type type, object obj )
|
||||
{
|
||||
return ( type.IsGenericType )
|
||||
&& ( type.GetGenericTypeDefinition() == typeof( IComparable<> ) )
|
||||
&& ( type.GetGenericArguments()[0].IsAssignableFrom( active ) );
|
||||
}, null );
|
||||
#endif
|
||||
|
||||
if ( ifaces.Length > 0 )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue