Example #1
0
        //---------------------------------------------------------------------
        void ParseNode(ScenarioEvent node)
        {
            node.subevents.Sort((a, b) =>
            {
                return(a.seq - b.seq);
            });

            foreach (var snode in node.subevents)
            {
                snode.parent = node;
                snode.bstart = false;
                if (snode.UID == node.StartSubEvent && node.StartSubEvent > 0)
                {
                    snode.bstart = true;
                }
                //node.parent = null;
                //node.path = RootPath + "\\" + node.text;
                ParseNode(snode);
            }
            node.exits.Sort((a, b) =>
            {
                if (a.Id == 0 && b.Id == 0)
                {
                    return(0);
                }

                if (a.Id == 0)
                {
                    return(int.MaxValue - b.Id);
                }
                if (b.Id == 0)
                {
                    return(a.Id - int.MaxValue);
                }
                return(a.Id - b.Id);
            });
            for (int i = 0; i < node.exits.Count; i++)
            {
                // node.exits[i].Id = i + 1;
            }
        }
Example #2
0
        //---------------------------------------------------------------------
        void ParseNode(ScenarioEvent node)
        {
            node.subevents.Sort((a, b) =>
            {
                return a.seq - b.seq;
            });

            foreach (var snode in node.subevents)
            {
                snode.parent = node;
                snode.bstart = false;
                if (snode.UID == node.StartSubEvent && node.StartSubEvent > 0)
                {
                    snode.bstart = true;
                }
                //node.parent = null;
                //node.path = RootPath + "\\" + node.text;
                ParseNode(snode);
            }
            node.exits.Sort((a, b) =>
            {
                if (a.Id == 0 && b.Id == 0) return 0;

                if (a.Id == 0) return int.MaxValue - b.Id;
                if (b.Id == 0) return a.Id - int.MaxValue;
                return a.Id - b.Id;
            });
            for (int i = 0; i < node.exits.Count; i++)
            {
                // node.exits[i].Id = i + 1;
            }
        }