Beispiel #1
0
        public void SetData(DefaultParamMethodData data, CancellationToken cancellationToken = default)
        {
            SemanticModel       = data.SemanticModel;
            OriginalDeclaration = data.Declaration;

            _symbol             = data.Symbol;
            _indentLevel        = DefaultParamUtilities.GetIndent(data.Declaration);
            _newModifierIndexes = data.NewModifierIndexes;
            _numNonDefaultParam = data.TypeParameters.NumNonDefaultParam;

            InitializeDeclaration(data, cancellationToken);

            if (data.CallInsteadOfCopying)
            {
                InitializeCallData(in data.TypeParameters);
            }
            else
            {
                _applyReturnSyntax = false;
                _callMethodSyntax  = null;
                _callArguments     = null;
                _callTypeArguments.Clear();
            }
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MethodDeclarationBuilder"/> class.
 /// </summary>
 /// <param name="data"><see cref="DefaultParamMethodData"/> to set as the <see cref="OriginalDeclaration"/>.</param>
 /// <param name="cancellationToken"><see cref="CancellationToken"/> that specifies if the operation should be canceled.</param>
 public MethodDeclarationBuilder(DefaultParamMethodData data, CancellationToken cancellationToken = default)
 {
     _callTypeArguments = new(4);
     SetData(data, cancellationToken);
 }