private void TryCreateProductionOrTestClass(IReadOnlyCollection <ITypeElement> typesInContext) { if (typesInContext.Count != 1) { MessageBox.ShowInfo("There is no single class in context to create production/test class from."); return; } ModificationUtility.TryCreateTestOrProductionClass(typesInContext.Single(), _textControl); }
public override ICollection <IOccurrence> Search(IProgressIndicator progressIndicator) { if (!_typeElement.IsValid()) { return(EmptyList <IOccurrence> .InstanceList); } var linkedTypes = LinkedTypesUtil.GetLinkedTypes(_typeElement); if (linkedTypes.Count == 0) { ModificationUtility.TryCreateTestOrProductionClass(_typeElement, _textControl); } bool IsDerivedName(ITypeElement typeElement) => _typeElement.ShortName.Contains(typeElement.ShortName) || typeElement.ShortName.Contains(_typeElement.ShortName); return(linkedTypes .Select(x => new LinkedTypesOccurrence(x, OccurrenceType.Occurrence, IsDerivedName(x))) .Where(x => !_derivedNamesOnly || x.HasNameDerived) .ToArray()); }