Added DeclaringType property to ReadableMember type

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-20 15:27:04 +02:00
1 親 02460a2dcb
コミット c78f51fad1
1ファイル変更
+14
+14
ファイルの表示
@@ -30,6 +30,20 @@ namespace ComputeSharp.Shaders.Translation.Models
Property = property;
}
/// <summary>
/// Gets the <see cref="Type"/> where the current member is declared in
/// </summary>
public Type DeclaringType
{
get
{
if (Field != null) return Field.DeclaringType;
if (Property != null) return Property.DeclaringType;
throw new InvalidOperationException("Field and property can't both be null at the same time");
}
}
/// <summary>
/// Gets the <see cref="Type"/> of the wrapped member for the current instance
/// </summary>