Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added easy to access enumerables for various member types.

  • Loading branch information...
commit a564ebbd37f6c74b7188d0d724dbbacd995913d9 1 parent a71670f
@mkrueger mkrueger authored
View
5 ICSharpCode.NRefactory/TypeSystem/ITypeDefinition.cs
@@ -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
View
26 ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedTypeDefinition.cs
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.