示例#1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            // stub up new empty item....
            XElement newItem = new XElement("Reagent",
                                            new XElement("TypeName", "Reagents."),
                                            new XElement("Quantity", "0")
                                            );

            machine.XML.Element("Reagents").Add(newItem);
            listBoxReagents.DataSource = machine.GetReagents();
        }
示例#2
0
        private void AddReagent(string reagent, int quantity)
        {
            // stub up new empty item....
            XElement newItem = new XElement("Reagent",
                                            new XElement("TypeName", reagent),
                                            new XElement("Quantity", quantity)
                                            );

            machine.XML.Element("Reagents").Add(newItem);
            listBoxReagents.DataSource    = machine.GetReagents();
            listBoxReagents.SelectedIndex = listBoxReagents.Items.Count - 1;
        }
示例#3
0
        public ReagentEdit(ThingMachine newMachine) : this()
        {
            // populate us...
            machine = newMachine;

            listBoxReagents.DataSource    = machine.GetReagents();
            listBoxReagents.DisplayMember = "Name";
            listBoxReagents.ValueMember   = "Self";
        }
示例#4
0
        public ReagentEdit(ThingMachine newMachine, int addQuantity, int topUpQuantity) : this()
        {
            // populate us...
            machine = newMachine;

            listBoxReagents.DataSource    = machine.GetReagents();
            listBoxReagents.DisplayMember = "Name";
            listBoxReagents.ValueMember   = "Self";

            AddQuantity   = addQuantity;
            TopUpQuantity = topUpQuantity;
        }