本文整理汇总了C#中NETRuby.NetRuby.GetCurrentContext方法的典型用法代码示例。如果您正苦于以下问题:C# NetRuby.GetCurrentContext方法的具体用法?C# NetRuby.GetCurrentContext怎么用?C# NetRuby.GetCurrentContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NETRuby.NetRuby
的用法示例。
在下文中一共展示了NetRuby.GetCurrentContext方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parser
public Parser(NetRuby rb)
{
evalTree = null;
ruby = rb;
thread = rb.GetCurrentContext();
compile_for_eval = false;
}
示例2: Init
internal static void Init(NetRuby rb)
{
RThreadGroupClass t = new RThreadGroupClass(rb);
t.DefineClass("ThreadGroup", rb.cObject);
rb.cThreadGroup = t;
t.DefineSingletonMethod("new", new RMethod(tg_new), -1);
t.DefineMethod("list", new RMethod(list), 0);
t.DefineMethod("add", new RMethod(add), 1);
RThreadGroup rg = (RThreadGroup)tg_new(t);
t.ConstSet(rb.intern("Default"), rg);
rg.Add(rb.GetCurrentContext());
}
示例3: Start
static internal RThread Start(NetRuby ruby, object[] args)
{
RThread parent = ruby.GetCurrentContext();
RThread thrd = (RThread)parent.Clone();
return thrd.Start(args);
}
示例4: matchSetter
static private void matchSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
{
rb.CheckType(val, typeof(RMatchData));
RThread th = rb.GetCurrentContext();
th.BackRef = val;
}
示例5: lastParenGetter
static private object lastParenGetter(uint id, GlobalEntry gb, NetRuby rb)
{
RThread th = rb.GetCurrentContext();
RMatchData m = (RMatchData)th.BackRef;
if (m == null) return null;
string s = m.Last;
if (m.IsTainted)
return new RString(rb, s, true);
return s;
}
示例6: matchGetter
static private object matchGetter(uint id, GlobalEntry gb, NetRuby rb)
{
RThread th = rb.GetCurrentContext();
object o = th.BackRef;
matchBusy(o);
return o;
}
示例7: errInfoGetter
static private object errInfoGetter(uint i, GlobalEntry gb, NetRuby rb)
{
RThread th = rb.GetCurrentContext();
return th.errInfo;
}
示例8: errInfoSetter
static private void errInfoSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
{
RThread th = rb.GetCurrentContext();
if (val != null)
{
RBasic b = rb.InstanceOf(val);
if (b.IsKindOf(rb.eException) == false)
throw new eTypeError("assigning non-exception to $!");
}
th.errInfo = (RException)val;
}
示例9: errAtSetter
static private void errAtSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
{
RThread th = rb.GetCurrentContext();
if (th.errInfo == null)
{
throw new ArgumentException("$! not set");
}
RException.exc_set_backtrace(th.errInfo, val);
}
示例10: errAtGetter
static private object errAtGetter(uint id, GlobalEntry gb, NetRuby rb)
{
RThread th = rb.GetCurrentContext();
if (th.errInfo != null)
{
return th.errInfo.Backtrace;
}
return null;
}