IronRuby.Builtins.RubyModule.SetDefinedMethodNoEventNoLock C# (CSharp) Метод

SetDefinedMethodNoEventNoLock() публичный Метод

public SetDefinedMethodNoEventNoLock ( RubyContext callerContext, string name, IronRuby.Runtime.Calls.RubyMemberInfo method, RubyMethodVisibility visibility ) : void
callerContext RubyContext
name string
method IronRuby.Runtime.Calls.RubyMemberInfo
visibility RubyMethodVisibility
Результат void
        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));
        }

Usage Example

Пример #1
0
        private static void DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self, string /*!*/ methodName, RubyMemberInfo /*!*/ info,
                                         RubyModule /*!*/ targetConstraint)
        {
            var visibility = GetDefinedMethodVisibility(scope, self, methodName);

            using (self.Context.ClassHierarchyLocker()) {
                // MRI 1.8 does the check when the method is called, 1.9 checks it upfront as we do:
                if (!self.HasAncestorNoLock(targetConstraint))
                {
                    throw RubyExceptions.CreateTypeError(
                              "bind argument must be a subclass of {0}", targetConstraint.GetName(scope.RubyContext)
                              );
                }

                self.SetDefinedMethodNoEventNoLock(self.Context, methodName, info, visibility);
            }

            self.MethodAdded(methodName);
        }
All Usage Examples Of IronRuby.Builtins.RubyModule::SetDefinedMethodNoEventNoLock
RubyModule