Added type and name properties to readable member class

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-18 12:48:08 +02:00
1 親 65667e855f
コミット 8a156e76bb
1ファイル変更
+19
+19
ファイルの表示
@@ -30,6 +30,25 @@ namespace ComputeSharp.Shaders.Translation.Models
Property = property;
}
/// <summary>
/// Gets the <see cref="Type"/> of the wrapped member for the current instance
/// </summary>
public Type MemberType
{
get
{
if (Field != null) return Field.FieldType;
if (Property != null) return Property.PropertyType;
throw new InvalidOperationException("Field and property can't both be null at the same time");
}
}
/// <summary>
/// Gets the name of the wrapped member for the current instance
/// </summary>
public string Name => (Field?.Name ?? Property?.Name) ?? throw new InvalidOperationException("Field and property can't both be null at the same time");
/// <summary>
/// Returns the value of the wrapped member for the current instance
/// </summary>