예제 #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);
        }
예제 #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));
        }
예제 #3
0
 public sealed override MethodName WithName(string name)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }
예제 #4
0
 internal override MethodName WithGenericParameters(GenericParameterName[] parameters)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }
예제 #5
0
 public override MethodName WithReturnParameter(TypeName returnType, IEnumerable <TypeName> requiredModifiers, IEnumerable <TypeName> optionalModifiers)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }
예제 #6
0
 protected override MemberName WithDeclaringTypeOverride(TypeName declaringType)
 {
     throw DotNetFailure.NotSupportedBySpecifications();
 }