i will start by saying i read every Jeremy Tammik post i found with no real clarity. i understand how to do it for an external command.
I have a node model i am writing, i need to subscribe to documentclosing event but it throws the API out of context bs. i cannot get it to work in my node model in C#.
> var curUiApp = DocumentManager.Instance.CurrentUIApplication;
var curApp = curUiApp.Application; currentDoc = curApp.OpenDocumentFile(file); currentDoc.DocumentClosing += CurrentDoc_DocumentClosing; // <---throws API out of context error here