Browse Source

Added doc comments.

pull/287/head
Joe4evr 8 years ago
parent
commit
546831f72c
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      src/Discord.Net.Commands/Attributes/TypeReaderAttribute.cs

+ 15
- 0
src/Discord.Net.Commands/Attributes/TypeReaderAttribute.cs View File

@@ -3,12 +3,27 @@ using System.Reflection;


namespace Discord.Commands namespace Discord.Commands
{ {
/// <summary>
/// Allows to override the <see cref="TypeReader"/> used for a parameter/type.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter, AllowMultiple = true)] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter, AllowMultiple = true)]
public class TypeReaderAttribute : Attribute public class TypeReaderAttribute : Attribute
{ {
/// <summary>
/// Type of the type that is read.
/// </summary>
public Type Type { get; } public Type Type { get; }

/// <summary>
/// <see cref="TypeInfo"/> of the specified <see cref="TypeReader"/>.
/// </summary>
public TypeInfo OverridingTypeReader { get; } public TypeInfo OverridingTypeReader { get; }


/// <summary>
/// Specify a <see cref="TypeReader"/> for a particular type.
/// </summary>
/// <param name="forType">Type of the type to read.</param>
/// <param name="typeReader">Type of the <see cref="TypeReader"/> that reads the type.</param>
public TypeReaderAttribute(Type forType, Type typeReader) public TypeReaderAttribute(Type forType, Type typeReader)
{ {
if (!typeof(TypeReader).GetTypeInfo().IsAssignableFrom(typeReader.GetTypeInfo())) if (!typeof(TypeReader).GetTypeInfo().IsAssignableFrom(typeReader.GetTypeInfo()))


Loading…
Cancel
Save