private bool TryInitialize( TService service, Document document, TextSpan textSpan, IList <ISymbol> selectedMembers, CancellationToken cancellationToken) { if (!selectedMembers.All(IsWritableInstanceFieldOrProperty)) { return(false); } this.TextSpan = textSpan; this.SelectedMembers = selectedMembers; this.ContainingType = this.SelectedMembers[0].ContainingType; if (this.ContainingType == null || this.ContainingType.TypeKind == TypeKind.Interface) { return(false); } this.Parameters = service.DetermineParameters(selectedMembers); if (service.HasMatchingConstructor(this.ContainingType, this.Parameters)) { return(false); } this.DelegatedConstructor = service.GetDelegatedConstructor(this.ContainingType, this.Parameters); return(this.DelegatedConstructor != null); }