例如:
红宝石代码( 仅用于测试) :
def process_initial_array (ar)
ar.join(" ")
end
c# code: Here I create List of strings and pass it to the IronRuby
List<string> source_values = new List<string>();
填充;
label2.Text=IronRuby.CSharp.BasicInteraction.calculator(source_values);
namespace IronRuby.CSharp
{
public class BasicInteraction
{internal static string calculator(List<string> source_values)
{
var rubyEngine = Ruby.CreateEngine();
var scope = rubyEngine.ExecuteFile("math_logic.rb");
string result = rubyEngine.Operations.InvokeMember(scope, "process_initial_array", source_values);
return result;
}
}
}
它提出:
An unhandled exception of type Microsoft.CSharp.RuntimeBinder.RuntimeBinderException occurred in Anonymously Hosted DynamicMethods Assembly
Additional information: Unable to convert implicitly "IronRuby.Builtins.MutableString" to "string". There is explicit conversion.
好,我找到铁鲁比字符串方法 在相关问题中找到_clar_string, 所以问题是我在哪里能找到关于 其它类型的相同方法的文件?