コード例 #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();
 }