示例#1
0
        private void FinalizePath(RoutePart route, PublishContentContext context, Action<RoutePart> processSlug) {
            var path = route.Path;
            route.Path = route.GetPathWithSlug(route.Slug);

            if (context.PublishingItemVersionRecord != null)
                processSlug(route);

            // if the path has changed by having the slug changed on the way in (e.g. user input) or to avoid conflict
            // then update and publish all contained items
            if (path != route.Path) {
                _routablePathConstraint.RemovePath(path);
                _routableService.FixContainedPaths(route);
            }

            if (!string.IsNullOrWhiteSpace(route.Path))
                _routablePathConstraint.AddPath(route.Path);
        }