当前位置: 首页>>代码示例>>C#>>正文


C# CallSite.Target方法代码示例

本文整理汇总了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));
 }
开发者ID:nieve,项目名称:ironruby,代码行数:10,代码来源:Protocols.cs

示例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;
 }
开发者ID:aceptra,项目名称:ironruby,代码行数:8,代码来源:IListOps.cs

示例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;
 }
开发者ID:nieve,项目名称:ironruby,代码行数:13,代码来源:Protocols.cs

示例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)));
 }
开发者ID:TerabyteX,项目名称:main,代码行数:4,代码来源:Protocols.cs

示例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);
 }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:4,代码来源:CommonDictionaryStorage.cs

示例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)); 
     }
 }
开发者ID:teejayvanslyke,项目名称:ironruby,代码行数:13,代码来源:RubyOps.cs

示例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);
            }
        }
开发者ID:tnachen,项目名称:ironruby,代码行数:11,代码来源:RubyExceptionData.cs

示例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]);
 }
开发者ID:mscottford,项目名称:ironruby,代码行数:3,代码来源:SplatCallSite.Generated.cs

示例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]);
 }
开发者ID:mscottford,项目名称:ironruby,代码行数:3,代码来源:SplatCallSite.Generated.cs

示例10: CallHelper1

 public static object CallHelper1(CallSite<Func<CallSite, object, object>> site, object[] args) {
     return site.Target(site, args[0]);
 }
开发者ID:mscottford,项目名称:ironruby,代码行数:3,代码来源:SplatCallSite.Generated.cs


注:本文中的System.Runtime.CompilerServices.CallSite.Target方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。