Exemple #1
0
 public override bool LoadToDesigner(List <UInt32> used, MethodDiagramViewer designer)
 {
     if (!used.Contains(this.BranchId))
     {
         used.Add(BranchId);
         if (_decisionTable != null)
         {
             ClassPointer list = designer.ActionEventCollection;
             if (list != null)
             {
                 for (int i = 0; i < _decisionTable.ConditionCount; i++)
                 {
                     if (_decisionTable[i].Actions != null)
                     {
                         for (int k = 0; k < _decisionTable[i].Actions.Count; k++)
                         {
                             _decisionTable[i].Actions[k].Action = this.ActionsHolder.GetActionInstance(_decisionTable[i].Actions[k].ActionId);
                             if (_decisionTable[i].Actions[k].Action == null)
                             {
                                 DesignUtil.WriteToOutputWindowAndLog("Action data for {0} not found [{1}] calling {1}.LoadToDesigner. You may delete it from the method and re-create it.", _decisionTable[i].Actions[k].ActionId, this.GetType().Name);
                             }
                         }
                     }
                 }
             }
         }
         return(designer.LoadAction(this));
     }
     return(false);
 }
Exemple #2
0
        public override bool LoadToDesigner(List <UInt32> used, MethodDiagramViewer designer)
        {
            if (!used.Contains(BranchId))
            {
                used.Add(BranchId);
                if (_actionList != null)
                {
                    ClassPointer list = designer.ActionEventCollection;
                    if (list != null)
                    {
                        for (int k = 0; k < _actionList.Count; k++)
                        {
                            TaskID tid = new TaskID(_actionList[k].ActionId, list.ClassId);
                            _actionList[k].Action = GetActionInstance(_actionList[k].ActionId);                            // list.GetAction(tid);

                            if (_actionList[k].Action == null)
                            {
                                _actionList[k].Action = designer.DesignerHolder.GetAction(tid);
                                if (_actionList[k].Action == null)
                                {
                                    DesignUtil.WriteToOutputWindowAndLog("Action data for {0} not found for [{1}] calling {2}.LoadToDesigner. You may delete it from the method and re-create it.", _actionList[k].ActionId, this.Name, this.GetType().Name);
                                }
                            }
                        }
                    }
                }
                return(designer.LoadAction(this));
            }
            return(false);
        }
 public override bool LoadToDesigner(List <UInt32> used, MethodDiagramViewer designer)
 {
     if (!used.Contains(BranchId))
     {
         used.Add(BranchId);
         ActionSubMethod act = (ActionSubMethod)_actId.LoadActionInstance(this.ActionsHolder);
         if (act != null)
         {
             _actionData = act;
         }
         else
         {
             if (_actionData != null)
             {
                 _actId.SetAction(_actionData);
             }
         }
         if (_actionData == null)
         {
             _actionData = (ActionSubMethod)designer.DesignerHolder.GetAction(_actId);
         }
         if (_actionData == null)
         {
             DesignUtil.WriteToOutputWindowAndLog("Action data for {0} not found for [{1}] calling {2}.LoadToDesigner", ActionId, this.Name, this.GetType().Name);
         }
         return(designer.LoadAction(this));
     }
     return(false);
 }
 public override bool LoadToDesigner(List <UInt32> used, MethodDiagramViewer designer)
 {
     if (!used.Contains(BranchId))
     {
         used.Add(BranchId);
         return(designer.LoadAction(this));
     }
     return(false);
 }
Exemple #5
0
 /// <summary>
 /// create action components and make port links
 /// </summary>
 /// <param name="designer"></param>
 public override bool LoadToDesigner(List <UInt32> used, MethodDiagramViewer designer)
 {
     if (designer.LoadAction(this))
     {
         if (_ifActions != null)
         {
             if (_ifActions.LoadToDesigner(used, designer))
             {
                 //make port link
                 if (this.OutPortList[0].LinkedInPort == null)
                 {
                     LinkLineNode end = this.OutPortList[0].End;
                     ActionPortIn pi  = _ifActions.GetInPort(this.OutPortList[0].LinkedPortID, this.OutPortList[0].LinkedPortInstanceID);
                     if (pi == null)
                     {
                         throw new MathException("Out port {0} is linked to [{1},{2}] of Branch {3}; but [{1},{2}] is not among the in-ports of the branch", this.OutPortList[0].PortID, this.OutPortList[0].LinkedPortID, this.OutPortList[0].LinkedPortInstanceID, _ifActions.BranchId);
                     }
                     LinkLineNode start = pi.Start;
                     end.SetNext(start);
                     start.SetPrevious(end);
                 }
             }
         }
         if (_elseActions != null)
         {
             if (_elseActions.LoadToDesigner(used, designer))
             {
                 //make port link
                 if (this.OutPortList[1].LinkedInPort == null)
                 {
                     LinkLineNode end = this.OutPortList[1].End;
                     ActionPortIn pi  = _elseActions.GetInPort(this.OutPortList[1].LinkedPortID, this.OutPortList[1].LinkedPortInstanceID);
                     if (pi == null)
                     {
                         throw new MathException("Out port {0} is linked to [{1},{2}] of Branch {3}; but [{1},{2}] is not among the in-ports of the branch", this.OutPortList[1].PortID, this.OutPortList[1].LinkedPortID, this.OutPortList[1].LinkedPortInstanceID, _elseActions.BranchId);
                     }
                     LinkLineNode start = pi.Start;
                     end.SetNext(start);
                     start.SetPrevious(end);
                 }
             }
         }
         return(true);
     }
     return(false);
 }
 /// <summary>
 /// create action component
 /// </summary>
 /// <param name="designer"></param>
 public override bool LoadToDesigner(List <UInt32> used, MethodDiagramViewer designer)
 {
     if (_actionData == null)
     {
         ClassPointer root = designer.ActionEventCollection;
         if (root != null && _actId != null)
         {
             _actionData = _actId.LoadActionInstance(this.ActionsHolder);
         }
         if (_actionData == null && _actId != null)
         {
             _actionData = designer.DesignerHolder.GetAction(_actId);
         }
         if (_actionData == null)
         {
             DesignUtil.WriteToOutputWindowAndLog("Action data for {0} not found for [{1}] calling {2}.LoadToDesigner. You may delete the action from the method and re-create it.", ActionId, this.Name, this.GetType().Name);
         }
     }
     return(designer.LoadAction(this));
 }
 public override bool LoadToDesigner(List <UInt32> used, MethodDiagramViewer designer)
 {
     return(designer.LoadAction(this));
 }