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));
        }
示例#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);
 }
示例#3
0
 private void btnRemove_Click(object sender, RoutedEventArgs e)
 {
     ListHolder.GetInstance().Vrooms.Remove((Vroom)lsbVrooms.SelectedItem);
 }
示例#4
0
 public MainWindow()
 {
     InitializeComponent();
     lsbVrooms.ItemsSource = ListHolder.GetInstance().Vrooms;
     btnRemove.IsEnabled   = false;
 }
示例#5
0
 public ReportWindow()
 {
     InitializeComponent();
     rtbReport.AppendText(ListHolder.GetInstance().Report());
 }