Message 1 of 13
Not applicable
01-31-2013
12:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
public void A()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
doc.SendStringToExecute("-overkill\np\n\n\n", true, false, false);
doc.CommandEnded += new CommandEventHandler(doc_CommandEnded);
}
public void doc_CommandEnded(object sender, CommandEventArgs e)
{
Document doc = sender as Document;
if (!doc.Editor.IsQuiescent) return;
DoSomeWork();
}As you can see above, I am trying to call DoSomeWork() after "-overkill" command finishes.
It looks like "-overkill" command is consits of a number of other commands because CommandEnded event gets triggered many times.
So I had to check if Editor is quiescent.
But the problem is CommandEnded event does not get tirggered when Editor.IsQuiescent.
So DoSomeWork() never gets called.
I also haved tried EnteringQuiescentState event instead of CommandEnded event, but it did not help.
EnteringQuiescentState event also gets called many times before "-overkill" command ends.
How could I solve this problem?
Any idea??
Solved! Go to Solution.

