コード例 #1
0
 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;
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public RoslynArrayType(IArrayTypeSymbol arrayTypeSymbol, ParseContext context)
     : base(arrayTypeSymbol, context)
 {
     _elementInitializer = new Lazy <RoslynType>(() => RoslynType.CreateType(ArrayTypeSymbol.ElementType, context));
 }