초기 커밋.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ExF.Class
|
||||
{
|
||||
public class MyCustomer
|
||||
{
|
||||
// 필드
|
||||
private string name;
|
||||
private int age;
|
||||
|
||||
// 이벤트
|
||||
public event EventHandler NameChanged;
|
||||
|
||||
// 생성자 (Constructor)
|
||||
public MyCustomer()
|
||||
{
|
||||
name = string.Empty;
|
||||
age = -1;
|
||||
}
|
||||
|
||||
// 속성
|
||||
public string Name
|
||||
{
|
||||
get { return this.name; }
|
||||
set
|
||||
{
|
||||
if (this.name != value)
|
||||
{
|
||||
this.name = value;
|
||||
if (NameChanged != null)
|
||||
{
|
||||
NameChanged(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public int Age
|
||||
{
|
||||
get { return this.age; }
|
||||
set { this.age = value; }
|
||||
}
|
||||
|
||||
// 메서드
|
||||
public string GetCustomerData()
|
||||
{
|
||||
string data = string.Format("Name: {0} (Age: {1})",
|
||||
this.Name, this.Age);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user