本文整理汇总了C#中System.Runtime.CompilerServices.CallSite.Target方法的典型用法代码示例。如果您正苦于以下问题:C# CallSite.Target方法的具体用法?C# CallSite.Target怎么用?C# CallSite.Target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.CompilerServices.CallSite
的用法示例。
在下文中一共展示了CallSite.Target方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsEqual
/// <summary>
/// Protocol for determining value equality in Ruby (uses IsTrue protocol on result of == call)
/// </summary>
public static bool IsEqual(CallSite<Func<CallSite, object, object, object>>/*!*/ site, object lhs, object rhs) {
// check reference equality first:
if (lhs == rhs) {
return true;
}
return IsTrue(site.Target(site, lhs, rhs));
}
示例2: IndexOf
internal static int IndexOf(CallSite<Func<CallSite, object, object, object>>/*!*/ equalitySite, IList/*!*/ self, object item) {
for (int i = 0; i < self.Count; i++) {
if (Protocols.IsTrue(equalitySite.Target(equalitySite, item, self[i]))) {
return i;
}
}
return -1;
}
示例3: CastToPath
/// <summary>
/// Converts an object to string using to_path-to_str protocol.
/// Protocol:
/// ? to_path => to_path() and to_str conversion on the result
/// ? to_str => to_str()
/// </summary>
public static MutableString/*!*/ CastToPath(CallSite<Func<CallSite, object, MutableString>>/*!*/ toPath, object obj) {
MutableString result = toPath.Target(toPath, obj);
if (result == null) {
throw RubyExceptions.CreateTypeConversionError("nil", "String");
}
return result;
}
示例4: RespondTo
public static bool RespondTo(CallSite<Func<CallSite, object, object, object>>/*!*/ respondToSite, RubyContext/*!*/ context, object target, string/*!*/ methodName)
{
return IsTrue(respondToSite.Target(respondToSite, target, context.EncodeIdentifier(methodName)));
}
示例5: AssignSiteDelegates
private void AssignSiteDelegates(CallSite<Func<CallSite, object, int>> hashSite, CallSite<Func<CallSite, object, object, bool>> equalSite) {
_hashFunc = (o) => hashSite.Target(hashSite, o);
_eqFunc = (o1, o2) => equalSite.Target(equalSite, o1, o2);
}
示例6: ExistsUnsplat
public static bool ExistsUnsplat(CallSite<Func<CallSite, object, object, object>>/*!*/ comparisonSite, object splattee, object value) {
var list = splattee as IList;
if (list != null) {
foreach (var item in list) {
if (IsTrue(comparisonSite.Target(comparisonSite, item, value))) {
return true;
}
}
return false;
} else {
return IsTrue(comparisonSite.Target(comparisonSite, splattee, value));
}
}
示例7: SetBacktrace
public void SetBacktrace(CallSite<Action<CallSite, RubyContext, Exception, RubyArray>> setBacktraceCallSite, RubyContext context, RubyArray backtrace) {
_backtraceInitialized = true;
if (context == null) {
// TODO: If we do not have a RubyContext, we cannot dispatch to the overriden Exception#set_backtrace method.
// We need to ensure that we have a non-null RubyContext.
Backtrace = backtrace;
} else {
setBacktraceCallSite.Target(setBacktraceCallSite, context, _exception, backtrace);
}
}
示例8: CallHelper10
public static object CallHelper10(CallSite<Func<CallSite, object, object, object, object, object, object, object, object, object, object, object>> site, object[] args) {
return site.Target(site, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
}
示例9: CallHelper5
public static object CallHelper5(CallSite<Func<CallSite, object, object, object, object, object, object>> site, object[] args) {
return site.Target(site, args[0], args[1], args[2], args[3], args[4]);
}
示例10: CallHelper1
public static object CallHelper1(CallSite<Func<CallSite, object, object>> site, object[] args) {
return site.Target(site, args[0]);
}