how to obtain translationUnit info in Machine Translation plugin correctly by using AbstractMachineTranslationProviderLanguageDirection

Hello, my friends

  I made a machine translation plugin for trados 2019 follow your develop guide book.

  but, there are some question on my code which about obtaining document words count(in every language) and the locked flag info of translation unit.

  sometimes, I used AbstractMachineTranslationProvider and AbstractMachineTranslationProviderLanguageDirection to build the plugin, but I couldn't avoid the locked TU or translated TU when user try to do pre-translate or open-translate.

  That makes me so crazy, Please help me.

  Thanks.

Wang Yuan