Initial Client/Server Communication
#1 Followed the MagicOnion quickstart guide, borrowing code from the chat sample app to get something working
This commit is contained in:
parent
52b0d4d8ff
commit
a0c8dbee72
493 changed files with 57790 additions and 3 deletions
49
Assets/Scripts/MessagePack/Internal/ReflectionExtensions.cs
Normal file
49
Assets/Scripts/MessagePack/Internal/ReflectionExtensions.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) All contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MessagePack.Internal
|
||||
{
|
||||
internal static class ReflectionExtensions
|
||||
{
|
||||
public static bool IsNullable(this System.Reflection.TypeInfo type)
|
||||
{
|
||||
return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(System.Nullable<>);
|
||||
}
|
||||
|
||||
public static bool IsPublic(this System.Reflection.TypeInfo type)
|
||||
{
|
||||
return type.IsPublic;
|
||||
}
|
||||
|
||||
public static bool IsAnonymous(this System.Reflection.TypeInfo type)
|
||||
{
|
||||
return type.GetCustomAttribute<CompilerGeneratedAttribute>() != null
|
||||
&& type.IsGenericType && type.Name.Contains("AnonymousType")
|
||||
&& (type.Name.StartsWith("<>") || type.Name.StartsWith("VB$"))
|
||||
&& (type.Attributes & TypeAttributes.NotPublic) == TypeAttributes.NotPublic;
|
||||
}
|
||||
|
||||
public static bool IsIndexer(this System.Reflection.PropertyInfo propertyInfo)
|
||||
{
|
||||
return propertyInfo.GetIndexParameters().Length > 0;
|
||||
}
|
||||
|
||||
public static bool IsConstructedGenericType(this System.Reflection.TypeInfo type)
|
||||
{
|
||||
return type.AsType().IsConstructedGenericType;
|
||||
}
|
||||
|
||||
public static MethodInfo GetGetMethod(this PropertyInfo propInfo)
|
||||
{
|
||||
return propInfo.GetMethod;
|
||||
}
|
||||
|
||||
public static MethodInfo GetSetMethod(this PropertyInfo propInfo)
|
||||
{
|
||||
return propInfo.SetMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue