Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string make  = txbMake.Text;
            string model = txbModel.Text;
            string color = txbColor.Text;
            double price = Convert.ToDouble(txbPrice.Text);

            ListHolder.GetInstance().AddVroom(new Vroom(make, model, price, color, 0));
        }
Ejemplo n.º 2
0
 //ensures only one thread of the method that creates the instance to run
 public static ListHolder getInstance()
 {
     if (instance == null)
     {
         lock (padlock)
         {
             if (instance == null)
             {
                 instance = new ListHolder();
             }
         }
     }
     return(instance);
 }
Ejemplo n.º 3
0
 private void btnRemove_Click(object sender, RoutedEventArgs e)
 {
     ListHolder.GetInstance().Vrooms.Remove((Vroom)lsbVrooms.SelectedItem);
 }
Ejemplo n.º 4
0
 public MainWindow()
 {
     InitializeComponent();
     lsbVrooms.ItemsSource = ListHolder.GetInstance().Vrooms;
     btnRemove.IsEnabled   = false;
 }
Ejemplo n.º 5
0
 public ReportWindow()
 {
     InitializeComponent();
     rtbReport.AppendText(ListHolder.GetInstance().Report());
 }