// FORM1.CS:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Lesson06
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
Car myCar = new Car();
myCar.Make = "Oldsmobile";
myCar.Model = "Cutlas Supreme";
myCar.ElapsedMileage = 200000;
MessageBox.Show(myCar.Make);
}
}
}
// CAR.CS
using System;
using System.Collections.Generic;
using System.Text;
namespace Lesson06
{
class Car
{
private string _make;
private string _model;
private int _elapsedMileage;
public string Make
{
get { return _make; }
set { _make = value; }
}
public string Model
{
get { return _model; }
set { _model = value; }
}
public int ElapsedMileage
{
get { return _elapsedMileage; }
set { _elapsedMileage = value; }
}
}
}