초기 커밋.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ExI.Event
|
||||
{
|
||||
class MyClass
|
||||
{
|
||||
public event EventHandler<EventArgs>? Complished;
|
||||
|
||||
public void Calc(int complexity)
|
||||
{
|
||||
Thread.Sleep(complexity);
|
||||
Complished?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
using ExI.Event;
|
||||
|
||||
var mycls = new MyClass();
|
||||
mycls.Complished += Mycls_Complished;
|
||||
|
||||
void Mycls_Complished(object? sender, EventArgs e)
|
||||
{
|
||||
Console.WriteLine("작업끝");
|
||||
}
|
||||
|
||||
mycls.Calc(2000);
|
||||
Reference in New Issue
Block a user