Esempio n. 1
0
        public virtual FlowElement FindFlowElement(string id)
        {
            FlowElement foundElement = null;

            if (!string.IsNullOrWhiteSpace(id))
            {
                foundElement = flowElementMap[id];
            }
            return(foundElement);
        }
Esempio n. 2
0
 public virtual void AddFlowElementToMap(FlowElement element)
 {
     if (element != null && !string.IsNullOrWhiteSpace(element.Id))
     {
         flowElementMap[element.Id] = element;
         if (ParentContainer != null)
         {
             ParentContainer.AddFlowElementToMap(element);
         }
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
        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);
                }
            }
        }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public virtual IFlowElementsContainer FindParent(FlowElement childElement)
 {
     return(FindParent(childElement, this));
 }