IronRuby.Builtins.RubyClass.GetClrExtensionMethods C# (CSharp) Method

GetClrExtensionMethods() private method

private GetClrExtensionMethods ( Type type, string name ) : IEnumerable
type System.Type
name string
return IEnumerable
        private IEnumerable<ExtensionMethodInfo>/*!*/ GetClrExtensionMethods(Type/*!*/ type, string/*!*/ name) {
            List<ExtensionMethodInfo> extensions;
            if (_extensionMethods != null && _extensionMethods.TryGetValue(name, out extensions)) {
                foreach (var extension in extensions) {
                    // Don't check IsExtensionOf: the target type of an extension method stored in _extensionMethods is 
                    // an instantiation (not parameterized), a generic parameter T (type == Object), or T[] (type == Array). 
                    // If the method's parameter is a constrained generic parameter (T or T[]) this might yield methods that
                    // shouldn't be available on the current type. They are filtered out in overload resolution.
                    // TODO: these methods show up in obj.methods; we need to fix that
                    yield return extension;
                }
            }

            foreach (var mixin in Mixins) {
                if (mixin._extensionMethods != null && mixin._extensionMethods.TryGetValue(name, out extensions)) {
                    foreach (var extension in extensions) {
                        if (extension.IsExtensionOf(type)) {
                            yield return extension;
                        }
                    }
                }
            }
        }