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


C# RubyMemberInfo.Copy方法代码示例

本文整理汇总了C#中IronRuby.Runtime.Calls.RubyMemberInfo.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# RubyMemberInfo.Copy方法的具体用法?C# RubyMemberInfo.Copy怎么用?C# RubyMemberInfo.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IronRuby.Runtime.Calls.RubyMemberInfo的用法示例。


在下文中一共展示了RubyMemberInfo.Copy方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetVisibilityNoEventNoLock

        // Module#module_function/private/protected/public:
        public void SetVisibilityNoEventNoLock(RubyContext/*!*/ callerContext, string/*!*/ name, RubyMemberInfo/*!*/ method, RubyMethodVisibility visibility) {
            Context.RequiresClassHierarchyLock();

            RubyMemberInfo existing;
            bool skipHidden = false;
            if (TryGetMethod(name, ref skipHidden, out existing)) {
                // CLR members: Detaches the member from its underlying type (by creating a copy).
                SetMethodNoEventNoLock(callerContext, name, method.Copy((RubyMemberFlags)visibility, this));
            } else {
                SetMethodNoEventNoLock(callerContext, name, new SuperForwarderInfo((RubyMemberFlags)visibility, method.DeclaringModule, name));
            }
        }
开发者ID:bclubb,项目名称:ironruby,代码行数:13,代码来源:RubyModule.cs

示例2: SetModuleFunctionNoEventNoLock

 // Module#module_function:
 public void SetModuleFunctionNoEventNoLock(RubyContext/*!*/ callerContext, string/*!*/ name, RubyMemberInfo/*!*/ method) {
     // CLR members: Detaches the member from its underlying type (by creating a copy).
     // TODO: check for CLR instance members, it should be an error to call module_function on them:
     SingletonClass.SetMethodNoEventNoLock(callerContext, name, method.Copy(RubyMemberFlags.Public, SingletonClass));
 }
开发者ID:bclubb,项目名称:ironruby,代码行数:6,代码来源:RubyModule.cs

示例3: SetVisibilityNoEventNoLock

        // Module#module_function/private/protected/public:
        public void SetVisibilityNoEventNoLock(RubyContext/*!*/ callerContext, string/*!*/ name, RubyMemberInfo/*!*/ method, RubyMethodVisibility visibility) {
            Context.RequiresClassHierarchyLock();

            RubyMemberInfo existing;
            bool skipHidden = false;
            if (TryGetMethod(name, ref skipHidden, out existing)) {
                SetMethodNoEventNoLock(callerContext, name, method.Copy((RubyMemberFlags)visibility, this));
            } else {
                SetMethodNoEventNoLock(callerContext, name, new RubyMemberInfo((RubyMemberFlags)visibility | RubyMemberFlags.SuperForwarder, method.DeclaringModule));
            }
        }
开发者ID:tnachen,项目名称:ironruby,代码行数:12,代码来源:RubyModule.cs

示例4: SetDefinedMethodNoEventNoLock

 // Module#define_method:
 public void SetDefinedMethodNoEventNoLock(RubyContext/*!*/ callerContext, string/*!*/ name, RubyMemberInfo/*!*/ method, RubyMethodVisibility visibility) {
     // CLR members: Detaches the member from its underlying type (by creating a copy).
     // Note: Method#== returns false on defined methods and redefining the original method doesn't affect the new one:
     SetMethodNoEventNoLock(callerContext, name, method.Copy((RubyMemberFlags)visibility, this));
 }
开发者ID:bclubb,项目名称:ironruby,代码行数:6,代码来源:RubyModule.cs

示例5: SetMethodVisibility

 public void SetMethodVisibility(string/*!*/ name, RubyMemberInfo/*!*/ method, RubyMethodVisibility visibility) {
     if (method.Visibility != visibility) {
         AddMethod(name, method.Copy((RubyMemberFlags)visibility, this));
     }
 }
开发者ID:mscottford,项目名称:ironruby,代码行数:5,代码来源:RubyModule.cs

示例6: AddModuleFunction

 // adds instance and singleton methods of a module function:
 public void AddModuleFunction(string/*!*/ name, RubyMemberInfo/*!*/ method) {
     AddMethod(name, method.Copy(RubyMemberFlags.Private, this));
     SingletonClass.AddMethod(name, method.Copy(RubyMemberFlags.Public, SingletonClass));
 }
开发者ID:mscottford,项目名称:ironruby,代码行数:5,代码来源:RubyModule.cs

示例7: AddDefinedMethod

 // adds method alias via define_method:
 public void AddDefinedMethod(string/*!*/ name, RubyMemberInfo/*!*/ method) {
     // copy method, Method#== returns false on defined methods:
     AddMethod(name, method.Copy(method.Flags, this));
 }
开发者ID:mscottford,项目名称:ironruby,代码行数:5,代码来源:RubyModule.cs

示例8: SetMethodVisibility

 public void SetMethodVisibility(RubyContext/*!*/ callerContext, string/*!*/ name, RubyMemberInfo/*!*/ method, RubyMethodVisibility visibility) {
     if (method.Visibility != visibility) {
         AddMethod(callerContext, name, method.Copy((RubyMemberFlags)visibility, this));
     }
 }
开发者ID:joshholmes,项目名称:ironruby,代码行数:5,代码来源:RubyModule.cs


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