Example #1
0
        private void AddToTreeList(IVehicleComponent vehicleComponent)
        {
            DesignTreelist.BeginUnboundLoad();

            TreeListNode ParentNodeForRoot = null;

            if (BodyNeedsToAdd)
            {
                ParentNodeForRoot = DesignTreelist.Nodes[0].Nodes[0].Nodes[0];
            }
            else if (SpringNeedsToAdd)
            {
                ParentNodeForRoot = DesignTreelist.Nodes[0].Nodes[0].Nodes[1];
            }
            else if (DamperNeedsToAdd)
            {
                ParentNodeForRoot = DesignTreelist.Nodes[0].Nodes[0].Nodes[2];
            }

            TreeListNode NewBody = DesignTreelist.AppendNode(new object[] { null }, ParentNodeForRoot, vehicleComponent);



            ParentNodeForRoot.LastNode.SetValue(DesignTreelistColumn, vehicleComponent.Name);

            DesignTreelist.EndUnboundLoad();

            DesignTreelist.ExpandAll();

            BodyNeedsToAdd   = false;
            SpringNeedsToAdd = false;
            DamperNeedsToAdd = false;
        }
Example #2
0
 public Mainform()
 {
     InitializeComponent();
     DesignTreelist.ExpandAll();
 }