public static void ProcessConfigurationFileElementAndChildren([NotNull] this IConfigurationFileElement configurationFileElement, [NotNull] ProcessConfigurationFileElement processConfigurationFileElement, [CanBeNull] Predicate <IConfigurationFileElement> skipElement = null) { void processTree(IConfigurationFileElement currConfigurationFileElement, ref bool stopProcessingParam) { if (stopProcessingParam || skipElement != null && skipElement(currConfigurationFileElement)) { return; } processConfigurationFileElement(currConfigurationFileElement, ref stopProcessingParam); if (stopProcessingParam) { return; } foreach (var childElement in currConfigurationFileElement.Children) { processTree(childElement, ref stopProcessingParam); if (stopProcessingParam) { return; } } } var stopProcessing = false; processTree(configurationFileElement, ref stopProcessing); }
public void ProcessTree(ProcessConfigurationFileElement processConfigurationFileElement) { this.ProcessConfigurationFileElementAndChildren(processConfigurationFileElement); }