本文整理汇总了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));
}
}
示例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));
}
示例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));
}
}
示例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));
}
示例5: SetMethodVisibility
public void SetMethodVisibility(string/*!*/ name, RubyMemberInfo/*!*/ method, RubyMethodVisibility visibility) {
if (method.Visibility != visibility) {
AddMethod(name, method.Copy((RubyMemberFlags)visibility, this));
}
}
示例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));
}
示例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));
}
示例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));
}
}