You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.0 KiB
30 lines
1.0 KiB
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using Microsoft.AspNet.SignalR.Json;
|
|
|
|
namespace Microsoft.AspNet.SignalR.Hubs
|
|
{
|
|
public static class MethodExtensions
|
|
{
|
|
[SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Justification = "The condition checks for null parameters")]
|
|
public static bool Matches(this MethodDescriptor methodDescriptor, IList<IJsonValue> parameters)
|
|
{
|
|
if (methodDescriptor == null)
|
|
{
|
|
throw new ArgumentNullException("methodDescriptor");
|
|
}
|
|
|
|
if ((methodDescriptor.Parameters.Count > 0 && parameters == null)
|
|
|| methodDescriptor.Parameters.Count != parameters.Count)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|