示例#1
0
文件: Helpers.cs 项目: yariza/Mirror
        public static bool ImplementsSyncObject(TypeReference typeRef)
        {
            try
            {
                // value types cant inherit from SyncObject
                if (typeRef.IsValueType)
                {
                    return(false);
                }

                return(Weaver.ImplementsInterface(typeRef.Resolve(), Weaver.SyncObjectType));
            }
            catch
            {
                // sometimes this will fail if we reference a weird library that can't be resolved, so we just swallow that exception and return false
            }

            return(false);
        }