Message 1 of 3
Disable IUpdater in Family Document
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
While implementing background applications using IUpdater I want to ensure it is only functioning in Project Documents and not Family Documents. I assume they will still load up when opening up a family, for instance. If that is the case, what are some ways to ensure my IUpdater is registered and functioning only when in a Project Document?
Can I check during the public Result OnStartUp() level
(How can I get Document doc at this level without ExternalCommandData?)
if(doc.IsFamilyDocument) { } else { UpdaterRegistry.RegisterUpdater(updater); rest of code }
Or do I have to test it at the public void Execute(UpdaterData data) level?:
Document doc = data.GetDocument(); if (doc.IsFamilyDocument) { } else { continue with rest of code }
Are these methods viable or is there a better way?