Ookii-dialogs-wpf: ProgressDialog๋Š” Progress๋ฅผ ๊ตฌํ˜„ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.<t/>

์— ๋งŒ๋“  2020๋…„ 03์›” 25์ผ  ยท  4์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: ookii-dialogs/ookii-dialogs-wpf

ProgressDialog๊ฐ€ ๋‹ค์Œ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๋ฉด ๋งค์šฐ ์œ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

System.IProgress<int> ์ง„ํ–‰๋ฅ  ๋ณด๊ณ 
System.IProgress<Text> - ํ…์ŠคํŠธ ์ง„ํ–‰ ์ƒํ™ฉ ๋ณด๊ณ 

๋”ฐ๋ผ์„œ ProgressDialog ๊ฐœ์ฒด๋Š” ์‹คํ–‰ ์ค‘์ธ ์ž‘์—…์— ์ผ๋ฐ˜ ๊ฐœ์ฒด๋กœ ์ „๋‹ฌ๋˜๊ณ  ์ง„ํ–‰๋ฅ  ๋ณด๊ณ ๋ฅผ ์œ„ํ•ด IProgress<int> ๋ฐ IProgress<Text> ๋กœ ์บ์ŠคํŠธ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

enhancement help wanted

๋ชจ๋“  4 ๋Œ“๊ธ€

@vpenades ์—๊ฒŒ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์ข‹์€ ์ƒ๊ฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ทธ๊ฒƒ์„ ์ฐ”๋Ÿฌ๋ณด๊ณ  PR์„ ๋ณด๋‚ด๊ณ  ์‹ถ๋‹ค๋ฉด ์•Œ๋ ค์ฃผ์‹ญ์‹œ์˜ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋‹ค์Œ ๋ฆด๋ฆฌ์Šค๋ฅผ ์œ„ํ•ด ๊ณง ์—ฐ๋ฝ ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.

ํ™๋ณด์ค€๋น„...

@vpenades Ookii.Dialogs.Wpf๋Š” ์ด์ œ .NET 5๋Š” ๋ฌผ๋ก  .NET Core 3.1๋„ ์ง€์›ํ•˜๋ฏ€๋กœ IProgress<T> ๊ตฌํ˜„์— ๋Œ€ํ•œ ๊ฐ€๋Šฅํ•œ ๊ฐœ์„  ์‚ฌํ•ญ์— ๋Œ€ํ•ด ๋…ผ์˜ํ•˜๊ธฐ ์‹œ์ž‘ํ•˜๋ ค๋Š” ๊ฒฝ์šฐ์— ๋Œ€๋น„ํ•ด ํ•‘์„ ๋ณด๋‚ด๋“œ๋ฆฌ๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

ps: ๋‹ต์žฅ์„ ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค. ์ด๊ฒƒ์€ ๊ท€ํ•˜์˜ ์‚ฌ์ „ ๊ด€์‹ฌ์„ ๊ฐ์•ˆํ•  ๋•Œ ์นœ์ ˆํ•œ ํ•‘์ž…๋‹ˆ๋‹ค.

๋Œ€๋ถ€๋ถ„์˜ ์‚ฌ์šฉ ์‚ฌ๋ก€๋Š” IProgress<T> ์˜ ์—ฌ๋Ÿฌ ๋ฒ„์ „์œผ๋กœ ์บ์ŠคํŒ…๋  ์ˆ˜ ์žˆ๋Š” Object ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”๋œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ž‘์—…์ด ๋  ๊ฒƒ์ด๋ฏ€๋กœ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ž‘์—…์˜ ์ง„ํ–‰ ์ƒํ™ฉ์„ ๋‹ค์‹œ ๋ณด๊ณ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ์ž˜ ์•Œ๋ ค์ ธ ์žˆ์ง€ ์•Š์•„์„œ ๋„๋ฆฌ ์‚ฌ์šฉ๋˜์ง€๋Š” ์•Š๋Š” ๊ฒƒ ๊ฐ™์ง€๋งŒ, IProgress<T> ๋Š” ๊ฝค ์˜ค๋ž˜์ „๋ถ€ํ„ฐ ์กด์žฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ๋žŒ๋“ค์ด ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ•˜๋Š”์ง€ ์•Œ์•„๋ณด๊ธฐ ์œ„ํ•ด ์ž‘์€ ๊ฒ€์ƒ‰์„ ํ•ด๋ณด๋‹ˆ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์‚ฌ์‹ค์„ ์•Œ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

```C#
์•„์ดํ”„๋กœ๊ทธ๋ ˆ์Šค// 0-1 ์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ๋ณด๊ณ ๋œ ์ง„ํ–‰๋ฅ 
์•„์ดํ”„๋กœ๊ทธ๋ ˆ์Šค// 0-100 ์‚ฌ์ด์˜ ๊ฐ’์œผ๋กœ ๋ณด๊ณ ๋œ ์ง„ํ–‰๋ฅ 


It is very tempting to have a structure that keeps all the information required by the progress dialog (percent, text, description), but this _must be avoided_  because that would mean the caller needs to fill that structure, which would force it to have a dependency on the ookii library, this is probably not desirable for background tasks, or pure code libraries that don't want to depend on an UI library.

So, in order to pass rich progress information, we need to use only BCL types and collections. Unfortunately, `IProgress<T>` does not define a standard....   but in general I guess everybody will expect (int Percent, string Text, string Description)

So, I would propose adding these interfaces:

```c#
IProgress<float> // by far, the implementation I've found most occurences searching on github.
IProgress< KeyValuePair<string,object> > // where key is the name of the property to set (percent, text, desc)

๋˜ํ•œ ํ˜„์žฌ IProgress<INT> ๋ฐ IProgress<STRING> ๋Š” ์ฝ˜ํ…์ธ ๋ฅผ ์บ์‹œํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์ƒํ˜ธ ๋ฐฐํƒ€์ ์ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ ์ฝ”๋“œ๋Š” ์ด๋ฏธ ์ง„ํ–‰ ์ƒํ™ฉ์„ ์บ์‹œํ•˜์ง€๋งŒ ํ…์ŠคํŠธ์—์„œ๋„ ๋™์ผํ•˜๊ฒŒ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ž‘์—…์€ ๋‹ค๋ฅธ ์†์„ฑ์— ๋Œ€ํ•œ ์ด์ „ ํ˜ธ์ถœ์—์„œ ์„ค์ •ํ•œ ๊ฐ’์„ ์žƒ์ง€ ์•Š๊ณ  ์ด๋Ÿฌํ•œ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์—ฐ์†์ ์œผ๋กœ ํ˜ธ์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰