public List <FlowElementType> FindFlowElementsInSubProcessOfType <FlowElementType>(SubProcess subProcess, bool goIntoSubprocesses) where FlowElementType : FlowElement { List <FlowElementType> foundFlowElements = new List <FlowElementType>(); foreach (FlowElement flowElement in subProcess.GetFlowElements()) { if (flowElement.GetType() == typeof(FlowElementType)) { foundFlowElements.Add((FlowElementType)flowElement); } if (flowElement is SubProcess) { if (goIntoSubprocesses) { foundFlowElements.AddRange(FindFlowElementsInSubProcessOfType <FlowElementType>((SubProcess)flowElement)); } } } return(foundFlowElements); }
public List <FlowElementType> FindFlowElementsInSubProcessOfType <FlowElementType>(SubProcess subProcess) where FlowElementType : FlowElement { return(FindFlowElementsInSubProcessOfType <FlowElementType>(subProcess, true)); }