64 lines
873 B
C#
64 lines
873 B
C#
internal class Program
|
|
{
|
|
private static void Main(string[] args)
|
|
{
|
|
var cls = new Class1();
|
|
cls.Run();
|
|
cls.Get();
|
|
cls.Put();
|
|
}
|
|
}
|
|
|
|
// 1. Partial Class - 3개로 분리한 경우
|
|
partial class Class1
|
|
{
|
|
public void Run() { }
|
|
}
|
|
|
|
partial class Class1
|
|
{
|
|
public void Get() { }
|
|
}
|
|
|
|
partial class Class1
|
|
{
|
|
public void Put() { }
|
|
}
|
|
|
|
// 2. Partial Struct
|
|
partial struct Struct1
|
|
{
|
|
public int ID;
|
|
}
|
|
|
|
partial struct Struct1
|
|
{
|
|
public string Name;
|
|
|
|
public Struct1(int id, string name)
|
|
{
|
|
this.ID = id;
|
|
this.Name = name;
|
|
}
|
|
}
|
|
|
|
// 3. Partial Interface
|
|
partial interface IDoable
|
|
{
|
|
string Name { get; set; }
|
|
}
|
|
|
|
partial interface IDoable
|
|
{
|
|
void Do();
|
|
}
|
|
|
|
// IDoable 인터페이스를 구현
|
|
public class DoClass : IDoable
|
|
{
|
|
public string Name { get; set; }
|
|
|
|
public void Do()
|
|
{
|
|
}
|
|
} |