public void Pack(PackageCreator creator) { if (Id == _pagesName) { #region All Pages HashSet <Guid> pages; using (var scope = new DataScope(DataScopeIdentifier.Administrated)) { pages = DataFacade.GetData <IPage>().Select(p => p.Id).ToHashSet(); } creator.AddData(typeof(IPage), DataScopeIdentifier.Public, d => pages.Contains((d as IPage).Id)); creator.AddData(typeof(IPage), DataScopeIdentifier.Administrated, d => pages.Contains((d as IPage).Id)); creator.AddData(typeof(IPagePlaceholderContent), DataScopeIdentifier.Public, d => pages.Contains((d as IPagePlaceholderContent).PageId)); creator.AddData(typeof(IPagePlaceholderContent), DataScopeIdentifier.Administrated, d => pages.Contains((d as IPagePlaceholderContent).PageId)); creator.AddData(typeof(IPageStructure), DataScopeIdentifier.Public, d => pages.Contains((d as IPageStructure).Id)); #endregion } else if (Id == _mediasName) { creator.AddData(typeof(IMediaFileData)); creator.AddData(typeof(IMediaFolderData)); creator.AddFilesInDirectory(@"App_Data\Media\"); } else if (Id == _datatypesName) { IEnumerable <Type> pageDataTypeInterfaces = PageFolderFacade.GetAllFolderTypes(); IEnumerable <Type> pageMetaTypeInterfaces = PageMetaDataFacade.GetAllMetaDataTypes(); foreach (var pageDataType in pageDataTypeInterfaces) { creator.AddDataTypeData(pageDataType); } foreach (var pageMetaType in pageMetaTypeInterfaces) { creator.AddDataTypeData(pageMetaType); } } else if (Id == _applicationsName) { creator.AddData <IDataItemTreeAttachmentPoint>(); } else if (Id == _metatypesName) { IEnumerable <Type> pageMetaTypeInterfaces = PageMetaDataFacade.GetAllMetaDataTypes(); foreach (var pageMetaType in pageMetaTypeInterfaces) { creator.AddDataTypeData(pageMetaType); } } return; }
public void Pack(PackageCreator creator) { if (Id == _pagesName) { #region All Pages HashSet<Guid> pages; using (var scope = new DataScope(DataScopeIdentifier.Administrated)) { pages = DataFacade.GetData<IPage>().Select(p => p.Id).ToHashSet(); } creator.AddData(typeof(IPage), DataScopeIdentifier.Public, d => pages.Contains((d as IPage).Id)); creator.AddData(typeof(IPage), DataScopeIdentifier.Administrated, d => pages.Contains((d as IPage).Id)); creator.AddData(typeof(IPagePlaceholderContent), DataScopeIdentifier.Public, d => pages.Contains((d as IPagePlaceholderContent).PageId)); creator.AddData(typeof(IPagePlaceholderContent), DataScopeIdentifier.Administrated, d => pages.Contains((d as IPagePlaceholderContent).PageId)); creator.AddData(typeof(IPageStructure), DataScopeIdentifier.Public, d => pages.Contains((d as IPageStructure).Id)); #endregion } else if (Id == _mediasName) { creator.AddData(typeof(IMediaFileData)); creator.AddData(typeof(IMediaFolderData)); creator.AddFilesInDirectory(@"App_Data\Media\"); } else if (Id == _datatypesName) { IEnumerable<Type> pageDataTypeInterfaces = PageFolderFacade.GetAllFolderTypes(); IEnumerable<Type> pageMetaTypeInterfaces = PageMetaDataFacade.GetAllMetaDataTypes(); foreach (var pageDataType in pageDataTypeInterfaces) { creator.AddDataTypeData(pageDataType); } foreach (var pageMetaType in pageMetaTypeInterfaces) { creator.AddDataTypeData(pageMetaType); } } else if (Id == _applicationsName) { creator.AddData<IDataItemTreeAttachmentPoint>(); } else if (Id == _metatypesName) { IEnumerable<Type> pageMetaTypeInterfaces = PageMetaDataFacade.GetAllMetaDataTypes(); foreach (var pageMetaType in pageMetaTypeInterfaces) { creator.AddDataTypeData(pageMetaType); } } return; }