Beispiel #1
0
 protected override IIntermediateTopLevelFieldMember GetField(TypedName nameAndType)
 {
     return(new IntermediateTopLevelFieldMember(nameAndType.Name, this.Parent)
     {
         FieldType = nameAndType.GetTypeRef()
     });
 }
 protected override IIntermediateInterfacePropertyMember OnGetProperty(TypedName nameAndType)
 {
     return(new PropertyMember(nameAndType.Name, (TInstanceType)this.Parent)
     {
         PropertyType = nameAndType.GetTypeRef()
     });
 }
Beispiel #3
0
        internal TIntermediateParameter _Add(TypedName parameterInfo)
        {
            var paramKind = parameterInfo.GetTypeRef();

            if (paramKind.ContainsSymbols())
            {
                paramKind = paramKind.SimpleSymbolDisambiguation(this.Parent);
            }
            return(this.AddInternal(parameterInfo.Name, paramKind, parameterInfo.Direction));
        }
Beispiel #4
0
        /// <summary>
        /// Adds a new <typeparamref name="TIntermediateSignature"/>
        /// instane with the <paramref name="parameters"/>, <paramref name="typeParameters"/>, <paramref name="nameAndReturn"/>
        /// provided.
        /// </summary>
        /// <param name="nameAndReturn">A <see cref="TypedName"/> which designates the name of the method and its
        /// return-type.</param>
        /// <param name="parameters">The <see cref="TypedNameSeries"/> which designates
        /// the parameter names and types of the new <typeparamref name="TIntermediateSignature"/>.</param>
        /// <param name="typeParameters">An array of <see cref="GenericParameterData"/> which
        /// defines the type-parameters and their individual type and functional constraints.</param>
        /// <returns>A new <typeparamref name="TIntermediateSignature"/>.</returns>
        /// <exception cref="System.ArgumentException">thrown when the name portion of <paramref name="nameAndReturn"/> is <see cref="String.Empty"/>
        /// or an element of <paramref name="parameters"/>, or <paramref name="typeParameters"/> contains an invalid type-reference (<see cref="System.Void"/>).</exception>
        /// <exception cref="System.ArgumentNullException">thrown when <paramref name="typeParameters"/>
        /// is null.</exception>
        public TIntermediateSignature Add(TypedName nameAndReturn, TypedNameSeries parameters, params GenericParameterData[] typeParameters)
        {
            TIntermediateSignature method = this.Add(nameAndReturn.Name, parameters, typeParameters);
            var returnType = nameAndReturn.GetTypeRef();

            if (returnType.ContainsSymbols())
            {
                method.ReturnType = returnType.SimpleSymbolDisambiguation(method);
            }
            else
            {
                method.ReturnType = returnType;
            }
            return(method);
        }
Beispiel #5
0
        /// <summary>
        /// Adds a new <typeparamref name="TIntermediateSignature"/>
        /// instance with the <paramref name="nameAndReturn"/> provided.
        /// </summary>
        /// <param name="nameAndReturn">A <see cref="TypedName"/> which designates the name of the method and its
        /// return-type.</param>
        /// <returns>A new <typeparamref name="TIntermediateSignature"/>.</returns>
        public TIntermediateSignature Add(TypedName nameAndReturn)
        {
            var method     = this.GetNewMethod(nameAndReturn.Name);
            var returnType = nameAndReturn.GetTypeRef();

            if (returnType.ContainsSymbols())
            {
                method.ReturnType = returnType.SimpleSymbolDisambiguation(method);
            }
            else
            {
                method.ReturnType = returnType;
            }
            this.AddDeclaration(method);
            return(method);
        }