Permalink
Browse files

Added easy to access enumerables for various member types.

  • Loading branch information...
1 parent a71670f commit a564ebbd37f6c74b7188d0d724dbbacd995913d9 @mkrueger mkrueger committed Nov 29, 2011
@@ -36,6 +36,11 @@ public interface IUnresolvedTypeDefinition : ITypeReference, IUnresolvedEntity
IList<IUnresolvedTypeDefinition> NestedTypes { get; }
IList<IUnresolvedMember> Members { get; }
+ IEnumerable<IUnresolvedMethod> Methods { get; }
+ IEnumerable<IUnresolvedProperty> Properties { get; }
+ IEnumerable<IUnresolvedField> Fields { get; }
+ IEnumerable<IUnresolvedEvent> Events { get; }
+
/// <summary>
/// Gets whether the type definition contains extension methods.
/// Returns null when the type definition needs to be resolved in order to determine whether
@@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
+using System.Linq;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
@@ -152,6 +153,31 @@ public DefaultUnresolvedTypeDefinition(IUnresolvedTypeDefinition declaringTypeDe
}
}
+ public IEnumerable<IUnresolvedMethod> Methods {
+ get {
+ return Members.OfType<IUnresolvedMethod> ();
+ }
+ }
+
+ public IEnumerable<IUnresolvedProperty> Properties {
+ get {
+ return Members.OfType<IUnresolvedProperty> ();
+ }
+ }
+
+ public IEnumerable<IUnresolvedField> Fields {
+ get {
+ return Members.OfType<IUnresolvedField> ();
+ }
+ }
+
+ public IEnumerable<IUnresolvedEvent> Events {
+ get {
+ return Members.OfType<IUnresolvedEvent> ();
+ }
+ }
+
+
public IType Resolve(ITypeResolveContext context)
{
if (context == null)

0 comments on commit a564ebb

Please sign in to comment.