Ejemplo n.º 1
0
        protected override MemberName WithDeclaringTypeOverride(TypeName declaringType)
        {
            if (declaringType.IsTypeSpecification)
            {
                var git = declaringType as GenericInstanceTypeName;
                if (git != null)
                {
                    declaringType = git.ElementType;
                }
                else
                {
                    throw DotNetFailure.NotSupportedBySpecifications();
                }
            }

            var result = new DefaultTypeName(_name, (DefaultTypeName)declaringType);

            CopyGenericsTo(result);
            return(result);
        }
Ejemplo n.º 2
0
        public TypeName GetNestedType(string name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (name.Length == 0)
            {
                throw Failure.EmptyString(nameof(name));
            }
            if (IsTypeSpecification && !IsGenericType)
            {
                throw DotNetFailure.NotSupportedBySpecifications();
            }

            TypeName tn;

            if (!TypeName.TryParse(name, TypeNameParseOptions.AssumeGenericParameters, out tn))
            {
                throw Failure.NotParsable(nameof(name), typeof(TypeName));
            }

            return(GetNestedType(tn));
        }
Ejemplo n.º 3
0
 public sealed override MethodName WithName(string name)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }
Ejemplo n.º 4
0
 internal override MethodName WithGenericParameters(GenericParameterName[] parameters)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }
Ejemplo n.º 5
0
 public override MethodName WithReturnParameter(TypeName returnType, IEnumerable <TypeName> requiredModifiers, IEnumerable <TypeName> optionalModifiers)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }
Ejemplo n.º 6
0
 protected override MemberName WithDeclaringTypeOverride(TypeName declaringType)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }