C# 클래스 EnterpriseWebLibrary.EnterpriseWebFramework.Controls.BlobFileOps

Contains methods for working with BLOB files.
파일 보기 프로젝트 열기: enduracode/enterprise-web-library 1 사용 예제들

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