cdfarrow / flextools

Python scripting utility for SIL FieldWorks Language Explorer (FLEx)
Other
16 stars 5 forks source link

How do I access ServiceLocator? #36

Closed milekpl closed 11 months ago

milekpl commented 11 months ago

In my old code base, I had:

m_lexExampleFactory = `DB.db.ServiceLocator.GetInstance(ILexExampleSentenceFactory)
    m_translationFactory = DB.db.ServiceLocator.GetInstance(ICmTranslationFactory)
    m_possibilityFactory = DB.db.ServiceLocator.GetInstance(ICmPossibilityRepository)

DB has been removed as a parameter, but this no longer works when I replace 'DB' with the project parameter. How do I access the object cache?

cdfarrow commented 11 months ago

The new form is project.project.ServiceLocator.GetInstance()