private void Document_Move_After(object sender, DocumentEventArgs e) { // Update on the Node itself, this will rebuild itself and it's children DynamicRouteInternalHelper.CommitTransaction(true); try { DynamicRouteEventHelper.DocumentInsertUpdated(e.Node.NodeID); var PreviousParentNodeID = Thread.GetData(Thread.GetNamedDataSlot("PreviousParentIDForNode_" + e.Node.NodeID)); if (PreviousParentNodeID != null && (int)PreviousParentNodeID != e.TargetParentNodeID) { // If differnet node IDs, it moved to another parent, so also run Document Moved check on both new and old parent DynamicRouteEventHelper.DocumentMoved((int)PreviousParentNodeID, e.TargetParentNodeID); } } catch (UrlSlugCollisionException ex) { LogErrorsInSeparateThread(ex, "DynamicRouting", "UrlSlugConflict", $"Occurred on Document After Before for Node {e.Node.NodeAliasPath}"); e.Cancel(); } catch (Exception ex) { LogErrorsInSeparateThread(ex, "DynamicRouting", "Error", $"Occurred on Document Move After for Node {e.Node.NodeAliasPath}"); } }