Skip to content

Commit

Permalink
Merge pull request #2 from KennanChan/dev
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
KennanChan authored Mar 1, 2020
2 parents af5df88 + a8e176c commit 783fd43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Revit.Async
Use Task-based asynchronous pattern (TAP) to run Revit API code from any execution context.

[中文说明](https://github.com/KennanChan/Revit.Async/blob/master/说明.md)
[中文说明](说明.md)

# Background

Expand All @@ -19,9 +19,9 @@ A [diagram](https://drive.google.com/file/d/1sb6Yrlt6zjkE9XBh4UB5sWV_i8nTpkmG/vi

or the maybe legacy screenshots:

![Revit API](https://github.com/KennanChan/Revit.Async/blob/master/RevitExternalEvent.png)
![Revit API](RevitExternalEvent.png)

![Revit.Async](https://github.com/KennanChan/Revit.Async/blob/master/Revit.Async.png)
![Revit.Async](Revit.Async.png)

If you are not familiar with Task-based asynchronous pattern (TAP), Here are some useful materials provided by Microsoft:

Expand Down
8 changes: 8 additions & 0 deletions 说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

Revit.Async这个库,正是对这套异步机制的一种实现,重点解决外部事件传参以及外部事件结果的回调,使得开发者可以更加自然地基于Revit API书写代码,而不必被Revit API的执行上下文所困扰。Revit.Async这个库内部,会自动将待执行的方法,委托给内部定义的特定外部事件,Raise这个事件之后,立即向调用方返回一个用于接收事件回调的Task,调用方只需要await这个Task,即可在外部事件处理完成之后,获取结果并继续剩下的其他业务逻辑。

这里有一个[图表](https://drive.google.com/file/d/1sb6Yrlt6zjkE9XBh4UB5sWV_i8nTpkmG/view?usp=sharing),展示了这两种机制,[点击查看](https://drive.google.com/file/d/1sb6Yrlt6zjkE9XBh4UB5sWV_i8nTpkmG/view?usp=sharing)

这里同样提供两张截图:

![Revit API](RevitExternalEvent.png)

![Revit.Async](Revit.Async.png)

如果你对基于任务的异步编程模型(TAP)还不太熟悉,这里有两篇微软官方提供的资料,相信可以帮助你更好地理解.NET异步机制。
https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/task-based-asynchronous-pattern-tap

Expand Down

0 comments on commit 783fd43

Please sign in to comment.