/// <summary> /// Initializes a new instance of the <see cref="GenericArgument"/> struct. /// </summary> /// <param name="location">The location.</param> /// <param name="position">The position.</param> /// <param name="type">The type.</param> /// <remarks></remarks> public GenericArgument(GenericArgumentLocation location, int position, [NotNull] Type type) : this() { if (type == null) throw new ArgumentNullException("type"); Location = location; Position = position; Type = type; }
/// <summary> /// Initializes a new instance of the <see cref="GenericArgument"/> struct. /// </summary> /// <param name="location">The location.</param> /// <param name="position">The position.</param> /// <param name="type">The type.</param> /// <remarks></remarks> public GenericArgument(GenericArgumentLocation location, int position, [NotNull] Type type) : this() { if (type == null) { throw new ArgumentNullException("type"); } Location = location; Position = position; Type = type; }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> /// <param name="type">The type.</param> /// <param name="name">The name.</param> /// <param name="location">The location.</param> /// <param name="position">The position.</param> /// <param name="isByReference">if set to <see langword="true"/> [is by reference].</param> /// <param name="isPointer">if set to <see langword="true"/> [is pointer].</param> /// <remarks></remarks> private TypeSearch( Type type = null, string name = null, GenericArgumentLocation location = GenericArgumentLocation.None, int position = -1, bool isByReference = false, bool isPointer = false) { Type = type; GenericArgumentName = name; GenericArgumentLocation = location; GenericArgumentPosition = position; IsByReference = isByReference; IsPointer = isPointer; }
/// <summary> /// Initializes a new instance of the <see cref="TypeSearch"/> class. /// </summary> /// <param name="type">The type.</param> /// <remarks></remarks> public TypeSearch([NotNull] Type type) : this(type, isByReference : type.IsByRef, isPointer : type.IsPointer) { if (type == null) { throw new ArgumentNullException("type"); } if (type.IsGenericParameter) { GenericArgumentLocation = type.DeclaringMethod != null ? GenericArgumentLocation.Signature : GenericArgumentLocation.Type; GenericArgumentPosition = type.GenericParameterPosition; GenericArgumentName = type.Name; } }
/// <summary> /// Initializes a new instance of the <see cref="TypeSearch"/> class. /// </summary> /// <param name="location">The location.</param> /// <param name="position">The position.</param> /// <param name="isByReference">if set to <see langword="true"/> is by reference.</param> /// <param name="isPointer">if set to <see langword="true"/> is pointer.</param> /// <remarks></remarks> public TypeSearch( GenericArgumentLocation location, int position, bool isByReference = false, bool isPointer = false) : this(null, null, location, position, isByReference, isPointer) { // Validate location switch (GenericArgumentLocation) { case GenericArgumentLocation.Signature: case GenericArgumentLocation.Type: break; default: throw new ArgumentOutOfRangeException("location"); } }
/// <summary> /// Initializes a new instance of the <see cref="TypeSearch"/> class. /// </summary> /// <param name="location">The location.</param> /// <param name="name">The name.</param> /// <param name="isByReference">if set to <see langword="true"/> is by reference.</param> /// <param name="isPointer">if set to <see langword="true"/> is pointer.</param> /// <remarks></remarks> public TypeSearch( GenericArgumentLocation location, [NotNull] string name, bool isByReference = false, bool isPointer = false) : this(null, name, location, -1, isByReference, isPointer) { // Validate location switch (GenericArgumentLocation) { case GenericArgumentLocation.Signature: case GenericArgumentLocation.Type: case GenericArgumentLocation.Any: break; default: throw new ArgumentOutOfRangeException("location"); } }
/// <summary> /// Initializes a new instance of the <see cref="TypeSearch"/> class. /// </summary> /// <param name="type">The type.</param> /// <remarks></remarks> public TypeSearch([NotNull] Type type) : this(type, isByReference: type.IsByRef, isPointer: type.IsPointer) { if (type == null) throw new ArgumentNullException("type"); if (type.IsGenericParameter) { GenericArgumentLocation = type.DeclaringMethod != null ? GenericArgumentLocation.Signature : GenericArgumentLocation.Type; GenericArgumentPosition = type.GenericParameterPosition; GenericArgumentName = type.Name; } }