/// <summary>Registers the converter.</summary> /// <param name="module">The module.</param> /// <param name="function">The function.</param> /// <param name="listUsersConverter">The list users converter.</param> protected void RegisterConverter(string module, string function, IErlangConverter listUsersConverter) { var key = this.GenerateKey(module, function); if (this.moduleAdapter.ContainsKey(key)) { var adapter = this.moduleAdapter[key]; var values = adapter.Split("%".ToCharArray()); AssertUtils.State(values.Length == 2, "The module adapter should be a map from 'module%function' to 'module%function'. " + "This one contained [" + adapter + "] which cannot be parsed to a module, function pair."); module = values[0]; function = values[1]; } this.converterMap.Add(this.GenerateKey(module, function), listUsersConverter); }
/// <summary>Registers the converter.</summary> /// <param name="module">The module.</param> /// <param name="function">The function.</param> /// <param name="listUsersConverter">The list users converter.</param> protected void RegisterConverter(string module, string function, IErlangConverter listUsersConverter) { var key = this.GenerateKey(module, function); if (this.moduleAdapter.ContainsKey(key)) { var adapter = this.moduleAdapter[key]; var values = adapter.Split("%".ToCharArray()); AssertUtils.State(values.Length == 2, "The module adapter should be a map from 'module%function' to 'module%function'. " + "This one contained [" + adapter + "] which cannot be parsed to a module, function pair."); module = values[0]; function = values[1]; } this.converterMap.Add(this.GenerateKey(module, function), listUsersConverter); }
private void RegisterConverter(string module, string function, IErlangConverter converter) { converterMap.Add(GenerateKey(module, function), converter); }
/// <summary>Executes the and convert RPC.</summary> /// <param name="module">The module.</param> /// <param name="function">The function.</param> /// <param name="converterToUse">The converter to use.</param> /// <param name="args">The args.</param> /// <returns>The OtpErlangObject.</returns> public object ExecuteAndConvertRpc(string module, string function, IErlangConverter converterToUse, params object[] args) { return(converterToUse.FromErlang(this.ExecuteRpc(module, function, converterToUse.ToErlang(args)))); }