private CodeDocParameter CreateReturn(ParameterInfo parameterInfo, ICodeDocMemberDataProvider provider) { Contract.Requires(parameterInfo != null); Contract.Requires(provider != null); Contract.Ensures(Contract.Result<CodeDocParameter>() != null); Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocParameter>().Name)); Contract.Ensures(Contract.Result<CodeDocParameter>().ParameterType != null); var returnType = parameterInfo.ParameterType; var model = new CodeDocParameter( "result", GetOrConvert(returnType, CodeDocMemberDetailLevel.Minimum)); model.IsReferenceType = !returnType.IsValueType; model.SummaryContents = provider.GetReturnSummaryContents().ToArray(); if (!model.NullRestricted.HasValue) model.NullRestricted = provider.EnsuresResultNotEverNull; return model; }
private CodeDocParameter CreateArgument(ParameterInfo parameterInfo, ICodeDocMemberDataProvider provider) { Contract.Requires(parameterInfo != null); Contract.Requires(provider != null); var parameterName = parameterInfo.Name; var parameterType = parameterInfo.ParameterType; var model = new CodeDocParameter( parameterName, GetOrConvert(parameterType, CodeDocMemberDetailLevel.Minimum)); model.IsOut = parameterInfo.IsOut; model.IsByRef = parameterType.IsByRef; model.IsReferenceType = !parameterType.IsValueType; model.SummaryContents = provider.GetParameterSummaryContents(parameterName).ToArray(); if (!model.NullRestricted.HasValue) model.NullRestricted = provider.RequiresParameterNotEverNull(parameterName); return model; }