C# 클래스 Nop.Services.Media.PictureService

Picture service
상속: IPictureService
파일 보기 프로젝트 열기: jimmy00784/nopCommerce-Linux-Mysql

공개 메소드들

메소드 설명
DeletePicture ( Nop.Core.Domain.Media.Picture picture ) : void

Deletes a picture

GetDefaultPictureUrl ( int targetSize, PictureType defaultPictureType = PictureType.Entity, bool useSsl = null ) : string

Gets the default picture URL

GetPictureById ( int pictureId ) : Nop.Core.Domain.Media.Picture

Gets a picture

GetPictureLocalPath ( Nop.Core.Domain.Media.Picture picture, int targetSize, bool showDefaultPicture = true ) : string

Get a picture local path

GetPictureSeName ( string name ) : string

Get picture SEO friendly name

GetPictureUrl ( Nop.Core.Domain.Media.Picture picture, int targetSize, bool showDefaultPicture = true, bool useSsl = null ) : string

Get a picture URL

GetPictureUrl ( int pictureId, int targetSize, bool showDefaultPicture = true, bool useSsl = null ) : string

Get a picture URL

GetPictures ( int pageIndex, int pageSize ) : IPagedList

Gets a collection of pictures

GetPicturesByProductId ( int productId ) : IList

Gets pictures by product identifier

GetPicturesByProductId ( int productId, int recordsToReturn ) : IList

Gets pictures by product identifier

InsertPicture ( byte pictureBinary, string mimeType, string seoFilename, bool isNew ) : Nop.Core.Domain.Media.Picture

Inserts a picture

LoadPictureBinary ( Nop.Core.Domain.Media.Picture picture ) : byte[]

Gets the loaded picture binary depending on picture storage settings

LoadPictureBinary ( Nop.Core.Domain.Media.Picture picture, bool fromDb ) : byte[]

Gets the loaded picture binary depending on picture storage settings

LoadPictureFromFile ( int pictureId, string mimeType ) : byte[]

Loads a cpiture from file

PictureService ( IRepository pictureRepository, IRepository productPictureRepository, ISettingService settingService, IWebHelper webHelper, IEventPublisher eventPublisher, Nop.Core.Domain.Media.MediaSettings mediaSettings ) : System

Ctor

SetSeoFilename ( int pictureId, string seoFilename ) : Nop.Core.Domain.Media.Picture

Updates a SEO filename of a picture

UpdatePicture ( int pictureId, byte pictureBinary, string mimeType, string seoFilename, bool isNew ) : Nop.Core.Domain.Media.Picture

Updates the picture

ValidatePicture ( byte pictureBinary, string mimeType ) : byte[]

Validates input picture dimensions

보호된 메소드들

메소드 설명
CalculateDimensions ( Size originalSize, int targetSize ) : Size

Calculates picture dimensions whilst maintaining aspect

DeletePictureOnFileSystem ( Nop.Core.Domain.Media.Picture picture ) : void

Delete a picture on file system

DeletePictureThumbs ( Nop.Core.Domain.Media.Picture picture ) : void

Delete picture thumbs

GetFileExtensionFromMimeType ( string mimeType ) : string

Returns the file extension from mime type.

GetImageCodecInfoFromExtension ( string fileExt ) : ImageCodecInfo

Returns the first ImageCodecInfo instance with the specified extension.

GetImageCodecInfoFromMimeType ( string mimeType ) : ImageCodecInfo

Returns the first ImageCodecInfo instance with the specified mime type.

SavePictureInFile ( int pictureId, byte pictureBinary, string mimeType ) : void

Save picture on file system

메소드 상세

CalculateDimensions() 보호된 메소드

Calculates picture dimensions whilst maintaining aspect
protected CalculateDimensions ( Size originalSize, int targetSize ) : Size
originalSize System.Drawing.Size The original picture size
targetSize int The target picture size (longest side)
리턴 System.Drawing.Size

DeletePicture() 공개 메소드

Deletes a picture
public DeletePicture ( Nop.Core.Domain.Media.Picture picture ) : void
picture Nop.Core.Domain.Media.Picture Picture
리턴 void

DeletePictureOnFileSystem() 보호된 메소드

Delete a picture on file system
protected DeletePictureOnFileSystem ( Nop.Core.Domain.Media.Picture picture ) : void
picture Nop.Core.Domain.Media.Picture Picture
리턴 void

DeletePictureThumbs() 보호된 메소드

Delete picture thumbs
protected DeletePictureThumbs ( Nop.Core.Domain.Media.Picture picture ) : void
picture Nop.Core.Domain.Media.Picture Picture
리턴 void

GetDefaultPictureUrl() 공개 메소드

Gets the default picture URL
public GetDefaultPictureUrl ( int targetSize, PictureType defaultPictureType = PictureType.Entity, bool useSsl = null ) : string
targetSize int The target picture size (longest side)
defaultPictureType PictureType Default picture type
useSsl bool Value indicating whether to get SSL protected picture URL; null to use the same value as the current page
리턴 string

GetFileExtensionFromMimeType() 보호된 메소드

Returns the file extension from mime type.
protected GetFileExtensionFromMimeType ( string mimeType ) : string
mimeType string Mime type
리턴 string

GetImageCodecInfoFromExtension() 보호된 메소드

Returns the first ImageCodecInfo instance with the specified extension.
protected GetImageCodecInfoFromExtension ( string fileExt ) : ImageCodecInfo
fileExt string File extension
리턴 ImageCodecInfo

GetImageCodecInfoFromMimeType() 보호된 메소드

Returns the first ImageCodecInfo instance with the specified mime type.
protected GetImageCodecInfoFromMimeType ( string mimeType ) : ImageCodecInfo
mimeType string Mime type
리턴 ImageCodecInfo

GetPictureById() 공개 메소드

Gets a picture
public GetPictureById ( int pictureId ) : Nop.Core.Domain.Media.Picture
pictureId int Picture identifier
리턴 Nop.Core.Domain.Media.Picture

GetPictureLocalPath() 공개 메소드

Get a picture local path
public GetPictureLocalPath ( Nop.Core.Domain.Media.Picture picture, int targetSize, bool showDefaultPicture = true ) : string
picture Nop.Core.Domain.Media.Picture Picture instance
targetSize int The target picture size (longest side)
showDefaultPicture bool A value indicating whether the default picture is shown
리턴 string

GetPictureSeName() 공개 메소드

Get picture SEO friendly name
public GetPictureSeName ( string name ) : string
name string Name
리턴 string

GetPictureUrl() 공개 메소드

Get a picture URL
public GetPictureUrl ( Nop.Core.Domain.Media.Picture picture, int targetSize, bool showDefaultPicture = true, bool useSsl = null ) : string
picture Nop.Core.Domain.Media.Picture Picture instance
targetSize int The target picture size (longest side)
showDefaultPicture bool A value indicating whether the default picture is shown
useSsl bool Value indicating whether to get SSL protected picture URL; null to use the same value as the current page
리턴 string

GetPictureUrl() 공개 메소드

Get a picture URL
public GetPictureUrl ( int pictureId, int targetSize, bool showDefaultPicture = true, bool useSsl = null ) : string
pictureId int Picture identifier
targetSize int The target picture size (longest side)
showDefaultPicture bool A value indicating whether the default picture is shown
useSsl bool Value indicating whether to get SSL protected picture URL; null to use the same value as the current page
리턴 string

GetPictures() 공개 메소드

Gets a collection of pictures
public GetPictures ( int pageIndex, int pageSize ) : IPagedList
pageIndex int Current page
pageSize int Items on each page
리턴 IPagedList

GetPicturesByProductId() 공개 메소드

Gets pictures by product identifier
public GetPicturesByProductId ( int productId ) : IList
productId int Product identifier
리턴 IList

GetPicturesByProductId() 공개 메소드

Gets pictures by product identifier
public GetPicturesByProductId ( int productId, int recordsToReturn ) : IList
productId int Product identifier
recordsToReturn int Number of records to return. 0 if you want to get all items
리턴 IList

InsertPicture() 공개 메소드

Inserts a picture
public InsertPicture ( byte pictureBinary, string mimeType, string seoFilename, bool isNew ) : Nop.Core.Domain.Media.Picture
pictureBinary byte The picture binary
mimeType string The picture MIME type
seoFilename string The SEO filename
isNew bool A value indicating whether the picture is new
리턴 Nop.Core.Domain.Media.Picture

LoadPictureBinary() 공개 메소드

Gets the loaded picture binary depending on picture storage settings
public LoadPictureBinary ( Nop.Core.Domain.Media.Picture picture ) : byte[]
picture Nop.Core.Domain.Media.Picture Picture
리턴 byte[]

LoadPictureBinary() 공개 메소드

Gets the loaded picture binary depending on picture storage settings
public LoadPictureBinary ( Nop.Core.Domain.Media.Picture picture, bool fromDb ) : byte[]
picture Nop.Core.Domain.Media.Picture Picture
fromDb bool Load from database; otherwise, from file system
리턴 byte[]

LoadPictureFromFile() 공개 메소드

Loads a cpiture from file
public LoadPictureFromFile ( int pictureId, string mimeType ) : byte[]
pictureId int Picture identifier
mimeType string MIME type
리턴 byte[]

PictureService() 공개 메소드

Ctor
public PictureService ( IRepository pictureRepository, IRepository productPictureRepository, ISettingService settingService, IWebHelper webHelper, IEventPublisher eventPublisher, Nop.Core.Domain.Media.MediaSettings mediaSettings ) : System
pictureRepository IRepository Picture repository
productPictureRepository IRepository Product picture repository
settingService ISettingService Setting service
webHelper IWebHelper Web helper
eventPublisher IEventPublisher Event publisher
mediaSettings Nop.Core.Domain.Media.MediaSettings Media settings
리턴 System

SavePictureInFile() 보호된 메소드

Save picture on file system
protected SavePictureInFile ( int pictureId, byte pictureBinary, string mimeType ) : void
pictureId int Picture identifier
pictureBinary byte Picture binary
mimeType string MIME type
리턴 void

SetSeoFilename() 공개 메소드

Updates a SEO filename of a picture
public SetSeoFilename ( int pictureId, string seoFilename ) : Nop.Core.Domain.Media.Picture
pictureId int The picture identifier
seoFilename string The SEO filename
리턴 Nop.Core.Domain.Media.Picture

UpdatePicture() 공개 메소드

Updates the picture
public UpdatePicture ( int pictureId, byte pictureBinary, string mimeType, string seoFilename, bool isNew ) : Nop.Core.Domain.Media.Picture
pictureId int The picture identifier
pictureBinary byte The picture binary
mimeType string The picture MIME type
seoFilename string The SEO filename
isNew bool A value indicating whether the picture is new
리턴 Nop.Core.Domain.Media.Picture

ValidatePicture() 공개 메소드

Validates input picture dimensions
public ValidatePicture ( byte pictureBinary, string mimeType ) : byte[]
pictureBinary byte Picture binary
mimeType string MIME type
리턴 byte[]