void WriteConstructs()
        {
            FixConstructor fix = null;
            RevConstructor rev = null;
            PrisConstructor pris = null;
            SphereConstructor sphere = null;

            foreach (var p in vmsModel.AllParts)
            {
                var con = p.Construct;
                if (con is FixConstruct)
                {
                    if (fix == null) fix = new FixConstructor();
                    fix.Add((FixConstruct)con);
                }
                else if (con is RevConstruct)
                {
                    if (rev == null) rev = new RevConstructor();
                    rev.Add((RevConstruct)con);
                }
                else if (con is PrisConstruct)
                {
                    if (pris == null) pris = new PrisConstructor();
                    pris.Add((PrisConstruct)con);
                }
                else if (con is SphereConstruct)
                {
                    if (sphere == null) sphere = new SphereConstructor();
                    sphere.Add((SphereConstruct)con);
                }
            }

            hprefs.Cons.Children = new List<LUtfNode>();
            if(fix != null) {
                hprefs.Cons.Children.Add(new LUtfNode() {
                    Name = "Fix", Parent = hprefs.Cons, Data = fix.GetData()
                });
            }
            if(rev != null) {
                hprefs.Cons.Children.Add(new LUtfNode() {
                    Name = "Rev", Parent = hprefs.Cons, Data = rev.GetData()
                });
            }
            if(pris != null) {
                hprefs.Cons.Children.Add(new LUtfNode() {
                    Name = "Pris", Parent = hprefs.Cons, Data = pris.GetData()
                });
            }
            if(sphere != null) {
                hprefs.Cons.Children.Add(new LUtfNode() {
                    Name = "Sphere", Parent = hprefs.Cons, Data = sphere.GetData()
                });
            }
        }
Exemplo n.º 2
0
        void WriteConstructs()
        {
            var               cmp    = (CmpFile)drawable;
            FixConstructor    fix    = null;
            RevConstructor    rev    = null;
            PrisConstructor   pris   = null;
            SphereConstructor sphere = null;

            foreach (var con in cmp.Constructs)
            {
                if (con is FixConstruct)
                {
                    if (fix == null)
                    {
                        fix = new FixConstructor();
                    }
                    fix.Add((FixConstruct)con);
                }
                else if (con is RevConstruct)
                {
                    if (rev == null)
                    {
                        rev = new RevConstructor();
                    }
                    rev.Add((RevConstruct)con);
                }
                else if (con is PrisConstruct)
                {
                    if (pris == null)
                    {
                        pris = new PrisConstructor();
                    }
                    pris.Add((PrisConstruct)con);
                }
                else if (con is SphereConstruct)
                {
                    if (sphere == null)
                    {
                        sphere = new SphereConstructor();
                    }
                    sphere.Add((SphereConstruct)con);
                }
            }

            hprefs.Cons.Children = new List <LUtfNode>();
            if (fix != null)
            {
                hprefs.Cons.Children.Add(new LUtfNode()
                {
                    Name = "Fix", Parent = hprefs.Cons, Data = fix.GetData()
                });
            }
            if (rev != null)
            {
                hprefs.Cons.Children.Add(new LUtfNode()
                {
                    Name = "Rev", Parent = hprefs.Cons, Data = rev.GetData()
                });
            }
            if (pris != null)
            {
                hprefs.Cons.Children.Add(new LUtfNode()
                {
                    Name = "Pris", Parent = hprefs.Cons, Data = pris.GetData()
                });
            }
            if (sphere != null)
            {
                hprefs.Cons.Children.Add(new LUtfNode()
                {
                    Name = "Sphere", Parent = hprefs.Cons, Data = sphere.GetData()
                });
            }
        }