Exemplo n.º 1
0
 void Create(XElement element)
 {
     XElement[] children = SimulinkXmlParser.GetChildren(element);
     foreach (XElement e in children)
     {
         string type = e.Name.LocalName;
         if (!type.Equals(SimulinkXmlParser.Block))
         {
             continue;
         }
         AddBlock(e);
     }
     foreach (XElement e in children)
     {
         string type = e.Name.LocalName;
         if (!type.Equals(SimulinkXmlParser.Line))
         {
             continue;
         }
         ProcessArrow(e);
     }
 }
Exemplo n.º 2
0
        void GetChildernBranches(XElement element, List <XElement> childern)
        {
            XElement[] ch = SimulinkXmlParser.GetChildren(element);
            if (ch.Length == 0)
            {
                if (element.Name.Equals(SimulinkXmlParser.Branch))
                {
                    childern.Add(element);
                }
                return;
            }
            bool b = true;

            foreach (XElement c in ch)
            {
                string type = c.Name.LocalName;
                if (!type.Equals(SimulinkXmlParser.Branch))
                {
                    continue;
                }
                XElement[] cch = SimulinkXmlParser.GetChildren(c);
                foreach (XElement el in cch)
                {
                    string tt = el.Name.LocalName;
                    if (!tt.Equals(SimulinkXmlParser.Branch))
                    {
                        continue;
                    }
                    b = false;
                    GetChildernBranches(el, childern);
                }
                if (b)
                {
                    childern.Add(c);
                }
            }
        }