Example #1
0
            private async Task <bool> TryInitializeClassDeclarationGenerationAsync(
                TService service,
                SemanticDocument document,
                SyntaxNode simpleName,
                CancellationToken cancellationToken)
            {
                if (service.TryInitializeClassDeclarationGenerationState(document, simpleName, cancellationToken,
                                                                         out var token, out var constructor, out var typeToGenerateIn))
                {
                    this.Token = token;
                    this.DelegatedConstructorOpt = constructor;
                    this.ParameterTypes          = constructor.Parameters.Select(p => p.Type).ToImmutableArray();
                    this.ParameterRefKinds       = constructor.Parameters.Select(p => p.RefKind).ToList();
                }
                cancellationToken.ThrowIfCancellationRequested();

                return(await TryDetermineTypeToGenerateInAsync(document, typeToGenerateIn, cancellationToken).ConfigureAwait(false));
            }