void tpwndo_WindowOpened(object sender, OoEventArgs e) { //check if window is a draw doc if (e != null && e.Source != null && e.Source is XAccessible) { var doc = OoAccessibility.IsDrawWindow(e.Source as XAccessible); if (doc != null && !(doc is bool)) { registerNewDrawWindow(e.Source as XAccessible, doc); } } }
void tpwndo_WindowActivated(object sender, OoEventArgs e) { if (e != null && e.Source != null && e.Source is XAccessible) { OoAccessibleDocWnd doc = getCorrespondingAccessibleDocForXaccessible(e.Source as XAccessible); if (doc != null && doc.MainWindow != null) { fireDrawWindowActivatedEvent(doc); } else { var docObj = OoAccessibility.IsDrawWindow(e.Source as XAccessible); if (docObj != null && !(docObj is bool)) { registerNewDrawWindow(e.Source as XAccessible, docObj); } } } }