Esempio n. 1
0
        public MethodSpec(MethodInfo mi)
        {
            m_MethodName = mi.Name;

            var rtp = mi.ReturnType;

            m_ReturnType = HashUtils.TypeHash(rtp);

            var pars = mi.GetParameters();

            m_Signature = new byte[pars.Length * sizeof(ulong)];
            for (var i = 0; i < pars.Length; i++)
            {
                var par = pars[i];
                if (par.ParameterType.IsByRef || par.IsOut || par.ParameterType.IsGenericParameter)
                {
                    throw new ServerContractException(StringConsts.GLUE_METHOD_SPEC_UNSUPPORTED_ERROR.Args(mi.DeclaringType.FullName, mi.Name, par.Name));
                }

                m_Signature.WriteBEUInt64(i * sizeof(ulong), HashUtils.TypeHash(pars[i].ParameterType));
            }

            m_Hash = HashUtils.StringIDHash(m_MethodName) ^ m_ReturnType ^ ((ulong)m_Signature.Length * 17);
        }
Esempio n. 2
0
 public TypeSpec(Type type)
 {
     m_Name = type.AssemblyQualifiedName;
     m_Hash = HashUtils.TypeHash(type);
 }