private void EnsureDeepZoomProjectItems(IProjectItem deepZoomProjectItem) { string[] directoryExtensions = DeepZoomHelper.GetDirectoryExtensions(deepZoomProjectItem.DocumentReference.Path); if (directoryExtensions != null) { string[] strArrays = directoryExtensions; for (int i = 0; i < (int)strArrays.Length; i++) { string str = strArrays[i]; Microsoft.Expression.Framework.Documents.DocumentReference documentReference = DeepZoomHelper.CreateDeepZoomDirectoryReference(deepZoomProjectItem.DocumentReference, str); IProjectItem projectItem = base.FindItem(documentReference); if (projectItem != null && !deepZoomProjectItem.Children.ToList <IProjectItem>().Contains(projectItem)) { this.RemoveProjectItem(projectItem, false); projectItem = null; } if (projectItem == null && Microsoft.Expression.Framework.Documents.PathHelper.FileOrDirectoryExists(documentReference.Path)) { IProjectItem folderProjectItem = new FolderProjectItem(this, documentReference, base.Services.DocumentTypes()[DocumentTypeNamesHelper.Folder], base.Services, true, Microsoft.Expression.Project.FileTable.GetImageSource("Resources\\Folder_DeepZoom.png")); if (this.AddProjectItem(folderProjectItem, ProjectItemEventOptions.None)) { deepZoomProjectItem.AddChild(folderProjectItem); } } } } }
private IProjectItem GetUpdatedItem(IProjectItem item, FileInfo fileInfo, CreationOptions creationOptions) { IDocumentType documentType = this.GetDocumentType(item.DocumentReference.Path); if (item.DocumentType == documentType) { return(null); } if (item.DocumentType == base.Services.DocumentTypes()[DocumentTypeNamesHelper.Xml] && documentType == base.Services.DocumentTypes()[DocumentTypeNamesHelper.DeepZoom]) { string[] directoryExtensions = DeepZoomHelper.GetDirectoryExtensions(item.DocumentReference.Path); for (int i = 0; i < (int)directoryExtensions.Length; i++) { string str = directoryExtensions[i]; Microsoft.Expression.Framework.Documents.DocumentReference documentReference = DeepZoomHelper.CreateDeepZoomDirectoryReference(item.DocumentReference, str); IProjectItem projectItem = base.FindItem(documentReference); if (projectItem != null) { this.RemoveProjectItem(projectItem, false); } } } this.RemoveProjectItem(item, false); DocumentCreationInfo documentCreationInfo = new DocumentCreationInfo() { TargetPath = fileInfo.FullName, CreationOptions = creationOptions, DocumentType = documentType }; return(base.AddItem(documentCreationInfo)); }
public static bool IsDeepZoomDocument(string fileName) { return(DeepZoomHelper.GetDirectoryExtensions(fileName) != null); }