Exemple #1
0
        //Получение информации с формы ввода
        public void GetInfo(string name, float weight, float cost)
        {
            //Создание новой вещи и ее добавления в коллекцию
            OneThing oneThing = new OneThing(name, weight, cost);

            things.Add(oneThing);
            //Суммирование веса и обновление поля
            WeightofAllThings        += weight;
            CurrentWeighttextBox.Text = WeightofAllThings.ToString();
            //Добавление вещи на textbox для всех вещей
            AlltextBox1.Text += oneThing.ToString() + Environment.NewLine;
        }
Exemple #2
0
 public OneField(OneThing thing)
 {
     this.thing = thing;
     condition  = Condition.Free;
 }
Exemple #3
0
 //Добавить вещь
 public void Add(OneThing newNode)
 {
     things.Add(new OneField(newNode));
 }
Exemple #4
0
 public OneField(string ThingName, string ThingWeight, string ThingCost)
 {
     thing     = new OneThing(ThingName, int.Parse(ThingWeight), int.Parse(ThingCost));
     condition = Condition.Free;
 }