internal static IMethodSymbol CreateAccessorSymbol(
     IMethodSymbol accessor,
     IList <AttributeData> attributes      = null,
     Accessibility?accessibility           = null,
     IMethodSymbol explicitInterfaceSymbol = null,
     IList <SyntaxNode> statements         = null)
 {
     return(CodeGenerationSymbolFactory.CreateMethodSymbol(
                attributes,
                accessibility ?? accessor.DeclaredAccessibility,
                accessor.GetSymbolModifiers().WithIsAbstract(statements == null),
                accessor.ReturnType,
                explicitInterfaceSymbol ?? accessor.ExplicitInterfaceImplementations.FirstOrDefault(),
                accessor.Name,
                accessor.TypeParameters,
                accessor.Parameters,
                statements,
                returnTypeAttributes: accessor.GetReturnTypeAttributes()));
 }
 internal static IEventSymbol CreateEventSymbol(
     IEventSymbol @event,
     IList <AttributeData> attributes     = null,
     Accessibility?accessibility          = null,
     SymbolModifiers?modifiers            = null,
     IEventSymbol explicitInterfaceSymbol = null,
     string name                = null,
     IMethodSymbol addMethod    = null,
     IMethodSymbol removeMethod = null)
 {
     return(CodeGenerationSymbolFactory.CreateEventSymbol(
                attributes,
                accessibility ?? @event.DeclaredAccessibility,
                modifiers ?? @event.GetSymbolModifiers(),
                @event.Type,
                explicitInterfaceSymbol,
                name ?? @event.Name,
                addMethod,
                removeMethod));
 }
Пример #3
0
 internal static IMethodSymbol CreateAccessorSymbol(
     IMethodSymbol accessor,
     ImmutableArray <AttributeData> attributes = default(ImmutableArray <AttributeData>),
     Accessibility?accessibility = null,
     ImmutableArray <IMethodSymbol> explicitInterfaceImplementations = default,
     ImmutableArray <SyntaxNode> statements = default(ImmutableArray <SyntaxNode>))
 {
     return(CodeGenerationSymbolFactory.CreateMethodSymbol(
                attributes,
                accessibility ?? accessor.DeclaredAccessibility,
                accessor.GetSymbolModifiers().WithIsAbstract(statements == null),
                accessor.ReturnType,
                accessor.ReturnsByRef,
                explicitInterfaceImplementations.IsDefault ? accessor.ExplicitInterfaceImplementations : explicitInterfaceImplementations,
                accessor.Name,
                accessor.TypeParameters,
                accessor.Parameters,
                statements,
                returnTypeAttributes: accessor.GetReturnTypeAttributes()));
 }
 internal static IMethodSymbol CreateMethodSymbol(
     IMethodSymbol method,
     IList <AttributeData> attributes      = null,
     Accessibility?accessibility           = null,
     SymbolModifiers?modifiers             = null,
     IMethodSymbol explicitInterfaceSymbol = null,
     string name = null,
     IList <SyntaxNode> statements = null)
 {
     return(CodeGenerationSymbolFactory.CreateMethodSymbol(
                attributes,
                accessibility ?? method.DeclaredAccessibility,
                modifiers ?? method.GetSymbolModifiers(),
                method.ReturnType,
                explicitInterfaceSymbol,
                name ?? method.Name,
                method.TypeParameters,
                method.Parameters,
                statements,
                returnTypeAttributes: method.GetReturnTypeAttributes()));
 }
 internal static IPropertySymbol CreatePropertySymbol(
     IPropertySymbol property,
     IList <AttributeData> attributes        = null,
     Accessibility?accessibility             = null,
     SymbolModifiers?modifiers               = null,
     IPropertySymbol explicitInterfaceSymbol = null,
     string name             = null,
     bool?isIndexer          = null,
     IMethodSymbol getMethod = null,
     IMethodSymbol setMethod = null)
 {
     return(CodeGenerationSymbolFactory.CreatePropertySymbol(
                attributes,
                accessibility ?? property.DeclaredAccessibility,
                modifiers ?? property.GetSymbolModifiers(),
                property.Type,
                explicitInterfaceSymbol,
                name ?? property.Name,
                property.Parameters,
                getMethod,
                setMethod,
                isIndexer ?? property.IsIndexer));
 }
Пример #6
0
 public ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType)
 => CodeGenerationSymbolFactory.CreatePointerTypeSymbol(pointedAtType);
Пример #7
0
 public ITypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank)
 => CodeGenerationSymbolFactory.CreateArrayTypeSymbol(elementType, rank);
Пример #8
0
 public ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType)
 {
     return(CodeGenerationSymbolFactory.CreatePointerTypeSymbol(pointedAtType));
 }