Skip to content

Commit

Permalink
update read me
Browse files Browse the repository at this point in the history
  • Loading branch information
KennanChan committed Feb 29, 2020
1 parent e284fcf commit 7246c19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public class MyRevitCommand : IExternalCommand
{
RevitTask.Initialize();
//Register SaveFamilyToDesktopExternalEventHandler ahead of time
RevitTask.Register(new SaveFamilyToDesktopExternalEventHandler());
RevitTask.RegisterGlobal(new SaveFamilyToDesktopExternalEventHandler());
var window = new MyWindow();
//Show modeless window
window.Show();
Expand Down Expand Up @@ -249,7 +249,7 @@ public class ButtonCommand : ICommand
});

//Raise your own handler
return await RevitTask.Raise<SaveFamilyToDesktopExternalEventHandler, Family, string>(randomFamily);
return await RevitTask.RaiseGlobal<SaveFamilyToDesktopExternalEventHandler, Family, string>(randomFamily);
}
catch (Exception)
{
Expand Down Expand Up @@ -291,6 +291,7 @@ public class SaveFamilyToDesktopExternalEventHandler :
# Todos

- Check current context to decide whether to create an IExternalEventHandler or to run code directly
- Support progress
- Support cancellation

# Issues
Expand Down
4 changes: 2 additions & 2 deletions 说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public class MyRevitCommand : IExternalCommand
//总是提前在Revit API的执行上下文中,初始化RevitTask
RevitTask.Initialize();
//提前注册外部事件
RevitTask.Register(new SaveFamilyToDesktopExternalEventHandler());
RevitTask.RegisterGlobal(new SaveFamilyToDesktopExternalEventHandler());
var window = new MyWindow();
//打开非模态窗体
window.Show();
Expand Down Expand Up @@ -248,7 +248,7 @@ public class ButtonCommand : ICommand
});

//Raise外部事件,传入参数,await这个异步任务,接收回调结果
return await RevitTask.Raise<SaveFamilyToDesktopExternalEventHandler, Family, string>(randomFamily);
return await RevitTask.RaiseGlobal<SaveFamilyToDesktopExternalEventHandler, Family, string>(randomFamily);
}
catch (Exception)
{
Expand Down

0 comments on commit 7246c19

Please sign in to comment.