Exemple #1
0
 private bool IsLogicCompatible(ElemBase origin, ElemBase adding)
 {
     if (origin.GetType() == typeof(ElemEnd))
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
 private void InsertTaskAfterElement(ElemBase origin, ElemBase adding)
 {
     adding.Task.VisualElement = adding;
     if (origin == null && adding.GetType() == typeof(ElemStart))
     {
         FunctionalElements.Add(adding.Task);
         VisualElements.Add(adding);
         return;
     }
     FunctionalElements.Insert(FunctionalElements.IndexOf(origin.Task) + 1, adding.Task);
     VisualElements.Insert(VisualElements.IndexOf(origin) + 1, adding);
 }
Exemple #3
0
 private bool TryAddNewElement(ElemBase origin, ElemBase adding)
 {
     if (origin != null && adding.GetType() != typeof(ElemStart))
     {
         if (!IsParameterCompatible(origin, adding))
         {
             return(false);
         }
         if (!IsLogicCompatible(origin, adding))
         {
             return(false);
         }
     }
     InsertTaskAfterElement(origin, adding);
     if (origin != null)
     {
         origin.NextElementReaction(adding);
     }
     adding.Task.AfterTaskAddition();
     adding.AfterElementAddition();
     return(true);
 }