public TestDescription( Type remotedInterfaceType, string remotedInterfaceKindName = "actor", bool useCRCIdGeneration = false, MethodReturnCheck methodReturnCheck = MethodReturnCheck.EnsureReturnsTask) : base(remotedInterfaceKindName, remotedInterfaceType, useCRCIdGeneration, methodReturnCheck) { }
private static MethodDescription[] GetMethodDescriptions( string remotedInterfaceKindName, Type remotedInterfaceType, MethodReturnCheck methodReturnCheck) { EnsureValidMethods(remotedInterfaceKindName, remotedInterfaceType, methodReturnCheck); var methods = remotedInterfaceType.GetMethods().Select( methodInfo => MethodDescription.Create(remotedInterfaceKindName, methodInfo)).ToList(); return(methods.ToArray()); }
protected InterfaceDescription( string remotedInterfaceKindName, Type remotedInterfaceType, MethodReturnCheck methodReturnCheck = MethodReturnCheck.EnsureReturnsTask) { EnsureNotGeneric(remotedInterfaceKindName, remotedInterfaceType); this.remotedInterfaceType = remotedInterfaceType; this.interfaceId = IdUtil.ComputeId(remotedInterfaceType); this.methods = GetMethodDescriptions(remotedInterfaceKindName, remotedInterfaceType, methodReturnCheck); }
private static MethodDescription[] GetMethodDescriptions( string remotedInterfaceKindName, Type remotedInterfaceType, MethodReturnCheck methodReturnCheck) { EnsureValidMethods(remotedInterfaceKindName, remotedInterfaceType, methodReturnCheck); var methods = remotedInterfaceType.GetMethods(); var methodDescriptions = new MethodDescription[methods.Length]; for (int i = 0; i < methods.Length; i++) { methodDescriptions[i] = MethodDescription.Create(remotedInterfaceKindName, methods[i]); } return(methodDescriptions); }
protected InterfaceDescription( string remotedInterfaceKindName, Type remotedInterfaceType, bool useCRCIdGeneration, MethodReturnCheck methodReturnCheck = MethodReturnCheck.EnsureReturnsTask) { EnsureNotGeneric(remotedInterfaceKindName, remotedInterfaceType); this.remotedInterfaceType = remotedInterfaceType; this.useCRCIdGeneration = useCRCIdGeneration; if (this.useCRCIdGeneration) { this.interfaceId = IdUtil.ComputeIdWithCRC(remotedInterfaceType); //This is needed for backward compatibility support to V1 Stack like ActorEventproxy this.interfaceIdV1 = IdUtil.ComputeId(remotedInterfaceType); } else { this.interfaceId = IdUtil.ComputeId(remotedInterfaceType); } this.methods = GetMethodDescriptions(remotedInterfaceKindName, remotedInterfaceType, methodReturnCheck, useCRCIdGeneration); }
private static void EnsureValidMethods( string remotedInterfaceKindName, Type remotedInterfaceType, MethodReturnCheck methodReturnCheck) { var methodNameSet = new HashSet <string>(); foreach (var m in remotedInterfaceType.GetMethods()) { EnsureNotOverloaded(remotedInterfaceKindName, remotedInterfaceType, m, methodNameSet); EnsureNotGeneric(remotedInterfaceKindName, remotedInterfaceType, m); EnsureNotVariableArgs(remotedInterfaceKindName, remotedInterfaceType, m); if (methodReturnCheck == MethodReturnCheck.EnsureReturnsTask) { EnsureReturnsTask(remotedInterfaceKindName, remotedInterfaceType, m); } if (methodReturnCheck == MethodReturnCheck.EnsureReturnsVoid) { EnsureReturnsVoid(remotedInterfaceKindName, remotedInterfaceType, m); } } }