public ApolloResult Register <TResp>(TalkerMessageWithoutReceiptHandler <TResp> handler) where TResp : IUnpackable { Type type = typeof(TResp); string fullName = type.FullName; return(this.Register <TResp>(fullName, handler)); }
public ApolloResult Register <TResp>(TalkerCommand.CommandDomain domain, TalkerMessageWithoutReceiptHandler <TResp> handler) where TResp : IUnpackable { Type typeFromHandle = typeof(TResp); string fullName = typeFromHandle.get_FullName(); return(this.Register <TResp>(new TalkerCommand(domain, fullName), handler)); }
public ApolloResult Register <TResp>(TalkerCommand command, TalkerMessageWithoutReceiptHandler <TResp> handler) where TResp : IUnpackable { if (command != null && handler != null) { ADebug.Log("Register:" + command); if (ApolloMessageManager.Instance.Exist(command)) { } ApolloMessage apolloMessage = new ApolloMessage(command); apolloMessage.RespType = typeof(TResp); apolloMessage.HandlerWithoutReceipt = delegate(IUnpackable resp) { handler((TResp)((object)resp)); }; ApolloMessageManager.Instance.Add(apolloMessage); return(ApolloResult.Success); } return(ApolloResult.InvalidArgument); }
public ApolloResult Register <TResp>(TalkerCommand command, TalkerMessageWithoutReceiptHandler <TResp> handler) where TResp : IUnpackable {
public ApolloResult Register <TResp>(string command, TalkerMessageWithoutReceiptHandler <TResp> handler) where TResp : IUnpackable { return(this.Register <TResp>(new TalkerCommand(TalkerCommand.CommandDomain.App, command), handler)); }
public ApolloResult RegisterMessage <TResp>(TalkerMessageWithoutReceiptHandler <TResp> handler) where TResp : IUnpackable { return(this.Register <TResp>(handler)); }