public RoslynMethodParameter(IParameterSymbol parameter, string comments, ParseContext context) { Name = parameter.Name; Comments = comments; ParameterType = RoslynType.CreateType(parameter.Type, context); Attributes = RoslynAttributeData.FromSymbol(parameter, context); IsOptional = parameter.IsOptional; }
public RoslynProperty(IPropertySymbol propSymbol, ParseContext context) { Name = propSymbol.Name; _propType = new Lazy <IType>(() => { return(RoslynType.CreateType(propSymbol.Type, context)); }); Comments = context.DocumentationProvider.GetDocumentationForSymbol(propSymbol).Summary; }
public RoslynProperty(IPropertySymbol propSymbol, ParseContext context) { Name = propSymbol.Name; _propType = new Lazy <IType>(() => { return(RoslynType.CreateType(propSymbol.Type, context)); }); _lazyAttributes = new Lazy <IEnumerable <IAttributeData> >(() => { return(RoslynAttributeData.FromSymbol(propSymbol, context)); }); Comments = context.DocumentationProvider.GetDocumentationForSymbol(propSymbol).Summary; }
public RoslynMethod(IMethodSymbol methodSymbol, ParseContext context) { Name = methodSymbol.Name; // Documentation XmlDocumentation doc = context.DocumentationProvider.GetDocumentationForSymbol(methodSymbol); SummaryComments = doc.Summary; ReturnsComments = doc.Returns; // Attributes _attrs = new Lazy <IReadOnlyList <IAttributeData> >(() => RoslynAttributeData.FromSymbol(methodSymbol, context)); // Return Type _returnType = new Lazy <IType>(() => { MethodReturnTypeHandler handler = context.GetMethodReturnTypeHandler(methodSymbol); IType returnType = handler.GetReturnType(context, methodSymbol); return(returnType); }); // Parameters _parameters = new List <IMethodParameter>(); foreach (IParameterSymbol oneParam in methodSymbol.Parameters) { string comments = ""; if (doc.Parameters.ContainsKey(oneParam.Name)) { comments = doc.Parameters[oneParam.Name]; } RoslynMethodParameter csParam = new RoslynMethodParameter(oneParam.Name, comments, RoslynType.CreateType(oneParam.Type, context)); _parameters.Add(csParam); } }
public RoslynArrayType(IArrayTypeSymbol arrayTypeSymbol, ParseContext context) : base(arrayTypeSymbol, context) { _elementInitializer = new Lazy <RoslynType>(() => RoslynType.CreateType(ArrayTypeSymbol.ElementType, context)); }