Пример #1
0
        public IWorkbookSaveOperation CreateSaveOperation()
        {
            var dependencies = new WorkbookDependencyCollector().Visit(this);
            var onlyPage     = dependencies.SingleOrDefault();

            return(new SaveOperation {
                Destination = logicalPath,
                AllDependencies = dependencies,
                OnlyPage = onlyPage.Key,
                OnlyPageHasDependencies = onlyPage.Key != null && onlyPage.Value.Count > 0,
                Options = SaveOptions
            });
        }
Пример #2
0
        public IWorkbookSaveOperation CreateSaveOperation(
            IWorkspaceService workspace)
        {
            var dependencies = new WorkbookDependencyCollector().Visit(this);
            var onlyPage     = dependencies.SingleOrDefault();

            var workspaceDependencies = workspace
                                        ?.GetExternalDependencies()
                                        ?.Select(dependency => dependency.Location);

            if (workspaceDependencies != null)
            {
                onlyPage.Value.AddRange(workspaceDependencies);
            }

            return(new SaveOperation {
                Destination = logicalPath,
                AllDependencies = dependencies,
                OnlyPage = onlyPage.Key,
                OnlyPageHasDependencies = onlyPage.Key != null && onlyPage.Value.Count > 0,
                Options = SaveOptions
            });
        }