本文整理汇总了C#中IronRuby类的典型用法代码示例。如果您正苦于以下问题:C# IronRuby类的具体用法?C# IronRuby怎么用?C# IronRuby使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IronRuby类属于命名空间,在下文中一共展示了IronRuby类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAlert_Class
private static void LoadAlert_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "hide_popup", 0x21,
0x00000000U,
new Action<IronRuby.Builtins.RubyModule>(rho.rubyext.RhoAlert.HidePopup)
);
DefineLibraryMethod(module, "play_file", 0x21,
0x00000006U,
new Action<IronRuby.Builtins.RubyModule, System.String, System.String>(rho.rubyext.RhoAlert.PlayFile)
);
DefineLibraryMethod(module, "show_popup", 0x21,
0x00000000U,
new Action<IronRuby.Builtins.RubyModule, IronRuby.Builtins.Hash>(rho.rubyext.RhoAlert.ShowPopup)
);
DefineLibraryMethod(module, "show_status", 0x21,
0x00000006U,
new Action<IronRuby.Builtins.RubyModule, System.String, System.String, System.String>(rho.rubyext.RhoAlert.ShowStatus)
);
DefineLibraryMethod(module, "vibrate", 0x21,
0x00000000U,
new Action<IronRuby.Builtins.RubyModule, System.Int32>(rho.rubyext.RhoAlert.Vibrate)
);
}
示例2: LoadMyIronRubyModule_Instance
private static void LoadMyIronRubyModule_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "Foo", 0x11,
0x00000000U,
new Action<System.Object>(AppendixB.MyModule.Foo)
);
}
示例3: LoadMyIronRubyModule__MyClass_Instance
private static void LoadMyIronRubyModule__MyClass_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "foo_bar?", 0x11,
0x00000000U,
new System.Func<IronRuby.Runtime.RubyContext, System.Object, System.Boolean>(AppendixB.MyModule.TheLandOfChocolate.IsFooBar)
);
}
示例4: LoadIronRuby__Builtins__MutableString_Class
private static void LoadIronRuby__Builtins__MutableString_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "json_create", 0x21,
0x00000000U,
new Func<IronRuby.Runtime.ConversionStorage<IronRuby.Runtime.IntegerValue>, IronRuby.Builtins.RubyClass, IronRuby.Builtins.Hash, IronRuby.Builtins.MutableString>(IronRuby.JsonExt.MutableStringOps.JsonCreate)
);
}
示例5: Compile
public override void Compile(Compiler compiler, IronRuby.Compiler.Ast.Node node, NodeParent parent)
{
var sae = (SimpleAssignmentExpression)node;
// substitute a method call of []= rather than the crap that ironruby's parser produces:
switch (sae.Left.NodeType)
{
case NodeTypes.ArrayItemAccess:
var aia = (ArrayItemAccess)sae.Left;
compiler.CompileNode(new MethodCall(aia.Array, "[]=", new Arguments(aia.Arguments.Expressions.Concat(new[] { sae.Right }).ToArray()), sae.Location), parent.CreateChild(node));
return;
case NodeTypes.AttributeAccess:
var aa = (AttributeAccess)sae.Left;
compiler.CompileNode(new MethodCall(aa.Qualifier, aa.Name, new Arguments(sae.Right), aa.Location), parent.CreateChild(node));
return;
}
compiler.CompileNode(sae.Right, parent.CreateChild(node));
if (sae.Operation != null)
{
compiler.AppendLine("$_stack[] = {0};", assignmentVar(sae.Left, parent));
compiler.AppendLine("$_stack[] = array_pop($_stack)->{0}(NULL, array_pop($_stack));", Mangling.RubyMethodToPHP(sae.Operation));
}
compiler.AppendLine("{0} = $_stack[count($_stack)-1];", assignmentVar(sae.Left, parent));
}
示例6: LoadIronRuby__Builtins__Hash_Instance
private static void LoadIronRuby__Builtins__Hash_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "to_json", 0x11,
0x00000000U,
new Func<IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Builtins.Hash, IronRuby.JsonExt.GeneratorState, System.Int32, IronRuby.Builtins.MutableString>(IronRuby.JsonExt.HashOps.ToJson)
);
}
示例7: LoadIronRuby__Builtins__FalseClass_Instance
private static void LoadIronRuby__Builtins__FalseClass_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "to_json", 0x11,
0x00000000U,
new Func<System.Boolean, IronRuby.JsonExt.GeneratorState, System.Int32, IronRuby.Builtins.MutableString>(IronRuby.JsonExt.FalseOps.ToJson)
);
}
示例8: OompaLoompa_Instance
private static void OompaLoompa_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "make_chocolate", 0x11,
new Func<IronRuby.Builtins.RubyClass, System.String, System.String, Chapter12.TheLandOfChocolate.Chocolate>(Chapter12.TheLandOfChocolate.OompaLoompa.MakeChocolate)
);
DefineLibraryMethod(module, "make_peppermint_chocolate", 0x11,
new Func<IronRuby.Builtins.RubyClass, System.String, Chapter12.TheLandOfChocolate.Chocolate>(Chapter12.TheLandOfChocolate.OompaLoompa.MakePepermintChocolate)
);
}
示例9: LoadIronRuby__Builtins__FalseClass_Instance
private static void LoadIronRuby__Builtins__FalseClass_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
module.DefineLibraryMethod("taguri", 0x11,
new System.Func<System.Object, IronRuby.Builtins.MutableString>(IronRuby.StandardLibrary.Yaml.YamlFalseOps.TagUri)
);
module.DefineLibraryMethod("to_yaml_node", 0x11,
new System.Func<System.Object, IronRuby.StandardLibrary.Yaml.RubyRepresenter, IronRuby.StandardLibrary.Yaml.Node>(IronRuby.StandardLibrary.Yaml.YamlFalseOps.ToYaml)
);
}
示例10: LoadIronRuby__Builtins__Integer_Instance
private static void LoadIronRuby__Builtins__Integer_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
module.DefineLibraryMethod("taguri", 0x11,
new System.Func<System.Object, IronRuby.Builtins.MutableString>(IronRuby.StandardLibrary.Yaml.YamlIntegerOps.TagUri)
);
module.DefineLibraryMethod("to_yaml_node", 0x12,
new System.Func<IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, System.Object, IronRuby.StandardLibrary.Yaml.RubyRepresenter, IronRuby.StandardLibrary.Yaml.Node>(IronRuby.StandardLibrary.Yaml.YamlIntegerOps.ToYaml)
);
}
示例11: LoadIronRuby__Builtins__Hash_Instance
private static void LoadIronRuby__Builtins__Hash_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
module.DefineLibraryMethod("taguri", 0x11,
new System.Func<IronRuby.Runtime.RubyContext, System.Object, IronRuby.Builtins.MutableString>(IronRuby.StandardLibrary.Yaml.YamlHashOps.TagUri)
);
module.DefineLibraryMethod("to_yaml_node", 0x12,
new System.Func<IronRuby.Builtins.Hash, IronRuby.StandardLibrary.Yaml.RubyRepresenter, IronRuby.StandardLibrary.Yaml.Node>(IronRuby.StandardLibrary.Yaml.YamlHashOps.ToYamlNode)
);
}
示例12: LoadIronRuby__Builtins__Integer_Instance
private void LoadIronRuby__Builtins__Integer_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
module.DefineLibraryMethod("taguri", 0x11, new System.Delegate[] {
new System.Func<System.Object, IronRuby.Builtins.MutableString>(IronRuby.StandardLibrary.Yaml.YamlIntegerOps.TagUri),
});
module.DefineLibraryMethod("to_yaml_node", 0x11, new System.Delegate[] {
new System.Func<System.Object, IronRuby.StandardLibrary.Yaml.RubyRepresenter, IronRuby.StandardLibrary.Yaml.Node>(IronRuby.StandardLibrary.Yaml.YamlIntegerOps.ToYaml),
});
}
示例13: LoadCamera_Class
private static void LoadCamera_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "choose_picture", 0x21,
0x00000002U,
new Action<IronRuby.Builtins.RubyModule, System.String>(rho.rubyext.RhoCamera.choosePicture)
);
DefineLibraryMethod(module, "take_picture", 0x21,
0x00000002U,
new Action<IronRuby.Builtins.RubyModule, System.String>(rho.rubyext.RhoCamera.takePicture)
);
}
示例14: LoadIronRuby__Builtins__FalseClass_Instance
private static void LoadIronRuby__Builtins__FalseClass_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "taguri", 0x11,
0x00000000U,
new Func<System.Boolean, IronRuby.Builtins.MutableString>(IronRuby.StandardLibrary.Yaml.YamlFalseOps.TagUri)
);
DefineLibraryMethod(module, "to_yaml_node", 0x12,
0x00000004U,
new Func<IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, System.Boolean, IronRuby.StandardLibrary.Yaml.RubyRepresenter, IronRuby.StandardLibrary.Yaml.Node>(IronRuby.StandardLibrary.Yaml.YamlFalseOps.ToYaml)
);
}
示例15: LoadIronRuby__Builtins__MutableString_Instance
private static void LoadIronRuby__Builtins__MutableString_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
DefineLibraryMethod(module, "to_json", 0x11,
0x00000000U,
new Func<IronRuby.Builtins.MutableString, IronRuby.JsonExt.GeneratorState, System.Int32, IronRuby.Builtins.MutableString>(IronRuby.JsonExt.MutableStringOps.ToJson)
);
DefineLibraryMethod(module, "to_json_raw", 0x11,
0x00000000U,
new Func<IronRuby.Runtime.RubyScope, IronRuby.Builtins.MutableString, IronRuby.Builtins.MutableString>(IronRuby.JsonExt.MutableStringOps.ToJsonRaw)
);
DefineLibraryMethod(module, "to_json_raw_object", 0x11,
0x00000000U,
new Func<IronRuby.Runtime.RubyScope, IronRuby.Builtins.MutableString, IronRuby.Builtins.Hash>(IronRuby.JsonExt.MutableStringOps.ToJsonRawObject)
);
}