C# Класс EnterpriseWebLibrary.EnterpriseWebFramework.Controls.BlobFileOps

Contains methods for working with BLOB files.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GetContentTypeForPostedFile string
GetThumbnailControl System.Web.UI.Control
Init void
OrderByName IEnumerable
OrderByUploadedDateDescending IEnumerable

Открытые методы

Метод Описание
CopyFileCollection ( int fileCollectionId ) : int

Copies the specified file collection and returns the ID of the copy.

GetFileLink ( int fileCollectionId, string labelOverride = null, string textIfNoFile = "" ) : Control

Returns a link to download a file with the given file collection ID. If no file is associated with the given file collection ID, returns a literal control with textIfNoFile text. The file name is used as the label unless labelOverride is specified. SystemBlobFileManagementProvider must be implemented.

GetFileLinkFromFileId ( int fileId, string labelOverride = null, string textIfNoFile = "" ) : Control

Returns a link to download a file with the given file ID. If no file is associated with the given file collection ID, returns a literal control with textIfNoFile text. The file name is used as the label unless labelOverride is specified. SystemBlobFileManagementProvider must be implemented.

GetFirstFileFromCollection ( int fileCollectionId ) : EnterpriseWebLibrary.EnterpriseWebFramework.Controls.BlobFile

Returns the first file in the specified file collection, or null if the collection is empty.

GetWidthAndHeightImageValidationMethod ( string subject, int width, int height ) : System.Drawing.Image>.Action

Provides a height/width image validation method without you having to create a custom validation method.

IsValidPdfFile ( Stream sourceStream ) : bool

Returns true if the file is a valid PDF file. Caller is responsible for opening and cleaning up the stream. You should check other meta information about the file (such as the extension) before calling this expensive method.

IsValidPdfFile ( byte contents ) : bool

Returns true if the file is a valid PDF file. You should check other meta information about the file (such as the extension) before calling this expensive method.

IsValidPdfFile ( int fileId ) : bool

SystemBlobFileManagementProvider must be implemented. You should check other meta information about the file (such as the extension) before calling this expensive method.

ValidateUploadedFile ( Validator validator, EwfFileUpload uploadedFile, string acceptableFileExtensions, System.Drawing.Image>.Action performAdditionalImageValidation, bool mustBeRenderableImage ) : void

Uploaded file cannot be null. But if uploadedFile.HasFile is false, this will be a no-op. Pass null for acceptableFileExtensions if there is no restriction on file extension. PerformAdditionalImageValidation cannot be null but may be an empty delegate.

Приватные методы

Метод Описание
GetContentTypeForPostedFile ( EnterpriseWebLibrary.IO.RsFile file ) : string

Returns the content type of the given HttpPostedFile.

GetThumbnailControl ( EnterpriseWebLibrary.EnterpriseWebFramework.Controls.BlobFile file, ResourceInfo>.Func thumbnailResourceInfoCreator ) : Control

Returns null if the file is null, the file is not an image, or there is no thumbnail resource info creator.

Init ( ) : void
OrderByName ( this rows ) : IEnumerable
OrderByUploadedDateDescending ( this rows ) : IEnumerable

Описание методов

CopyFileCollection() публичный статический Метод

Copies the specified file collection and returns the ID of the copy.
public static CopyFileCollection ( int fileCollectionId ) : int
fileCollectionId int
Результат int

GetFileLink() публичный статический Метод

Returns a link to download a file with the given file collection ID. If no file is associated with the given file collection ID, returns a literal control with textIfNoFile text. The file name is used as the label unless labelOverride is specified. SystemBlobFileManagementProvider must be implemented.
public static GetFileLink ( int fileCollectionId, string labelOverride = null, string textIfNoFile = "" ) : Control
fileCollectionId int
labelOverride string
textIfNoFile string
Результат System.Web.UI.Control

GetFileLinkFromFileId() публичный статический Метод

Returns a link to download a file with the given file ID. If no file is associated with the given file collection ID, returns a literal control with textIfNoFile text. The file name is used as the label unless labelOverride is specified. SystemBlobFileManagementProvider must be implemented.
public static GetFileLinkFromFileId ( int fileId, string labelOverride = null, string textIfNoFile = "" ) : Control
fileId int
labelOverride string
textIfNoFile string
Результат System.Web.UI.Control

GetFirstFileFromCollection() публичный статический Метод

Returns the first file in the specified file collection, or null if the collection is empty.
public static GetFirstFileFromCollection ( int fileCollectionId ) : EnterpriseWebLibrary.EnterpriseWebFramework.Controls.BlobFile
fileCollectionId int
Результат EnterpriseWebLibrary.EnterpriseWebFramework.Controls.BlobFile

GetWidthAndHeightImageValidationMethod() публичный статический Метод

Provides a height/width image validation method without you having to create a custom validation method.
public static GetWidthAndHeightImageValidationMethod ( string subject, int width, int height ) : System.Drawing.Image>.Action
subject string
width int
height int
Результат System.Drawing.Image>.Action

IsValidPdfFile() публичный статический Метод

Returns true if the file is a valid PDF file. Caller is responsible for opening and cleaning up the stream. You should check other meta information about the file (such as the extension) before calling this expensive method.
public static IsValidPdfFile ( Stream sourceStream ) : bool
sourceStream Stream
Результат bool

IsValidPdfFile() публичный статический Метод

Returns true if the file is a valid PDF file. You should check other meta information about the file (such as the extension) before calling this expensive method.
public static IsValidPdfFile ( byte contents ) : bool
contents byte
Результат bool

IsValidPdfFile() публичный статический Метод

SystemBlobFileManagementProvider must be implemented. You should check other meta information about the file (such as the extension) before calling this expensive method.
public static IsValidPdfFile ( int fileId ) : bool
fileId int
Результат bool

ValidateUploadedFile() публичный статический Метод

Uploaded file cannot be null. But if uploadedFile.HasFile is false, this will be a no-op. Pass null for acceptableFileExtensions if there is no restriction on file extension. PerformAdditionalImageValidation cannot be null but may be an empty delegate.
public static ValidateUploadedFile ( Validator validator, EwfFileUpload uploadedFile, string acceptableFileExtensions, System.Drawing.Image>.Action performAdditionalImageValidation, bool mustBeRenderableImage ) : void
validator Validator
uploadedFile EwfFileUpload
acceptableFileExtensions string
performAdditionalImageValidation System.Drawing.Image>.Action
mustBeRenderableImage bool
Результат void