public virtual FlowElement FindFlowElement(string id) { FlowElement foundElement = null; if (!string.IsNullOrWhiteSpace(id)) { foundElement = flowElementMap[id]; } return(foundElement); }
public virtual void AddFlowElementToMap(FlowElement element) { if (element != null && !string.IsNullOrWhiteSpace(element.Id)) { flowElementMap[element.Id] = element; if (ParentContainer != null) { ParentContainer.AddFlowElementToMap(element); } } }
public virtual void AddFlowElement(FlowElement element) { flowElementList.Add(element); element.ParentContainer = this; if (!string.IsNullOrWhiteSpace(element.Id)) { flowElementMap[element.Id] = element; } if (element is IFlowElementsContainer) { flowElementMap.PutAll(((IFlowElementsContainer)element).FlowElementMap); } }
public virtual void RemoveFlowElement(string elementId) { FlowElement element = FindFlowElement(elementId); if (element != null) { flowElementList.Remove(element); flowElementMap.Remove(elementId); if (element.ParentContainer != null) { element.ParentContainer.RemoveFlowElementFromMap(elementId); } } }
public virtual IFlowElementsContainer FindParent(FlowElement childElement, IFlowElementsContainer flowElementsContainer) { foreach (FlowElement flowElement in flowElementsContainer.FlowElements) { if (childElement.Id is object && childElement.Id.Equals(flowElement.Id)) { return(flowElementsContainer); } if (flowElement is IFlowElementsContainer) { IFlowElementsContainer result = FindParent(childElement, (IFlowElementsContainer)flowElement); if (result != null) { return(result); } } } return(null); }
public virtual IFlowElementsContainer FindParent(FlowElement childElement) { return(FindParent(childElement, this)); }