C# 클래스 PAWA.Classes.Tools

파일 보기 프로젝트 열기: jarradm/PAWA

Private Properties

프로퍼티 타입 설명
HexByteArrayToHexString string

공개 메소드들

메소드 설명
CreateFilename ( int userid, string filename ) : string
CreateTagCloudOverlayContents ( List tags ) : string
GetFilesFromFolder ( int folderID, int userId ) : IEnumerable
GetTop100Tags ( IPAWAContext dbContext ) : List

Gets the 100 most used tags from the database.

GetUsers ( ) : IEnumerable

Gets all users

ImageResize ( Image imgFile, Size newSize ) : Image

Take in image, create a new bitmap, bitmap size = newsize Render and clean image Apply image to bitmap Return the thumbnail

PhotoValidation ( System.Web.HttpPostedFileBase image ) : System.Boolean

Confirms that the file uploaded is not null and is a image of the required type.

TagUsedCountIncrease ( string tagName ) : void

Increase the selected tags usedcount in the database by 1 everytime this method is called

changeFolderName ( int userID, int folderID, string newFolderName ) : bool
checkExtension ( string file ) : System.Drawing.Imaging.ImageFormat

Checks the extension of the image and returns the correct format for saving

checkIfTagExists ( string TagArr ) : List

Will used the passed array to compare against the DB, if the tag doesnt exist it will create it. returning all of the images tags IDs in a List(int)

convertTagsToString ( List TagIDs ) : string

Combines all the tagIDs from a List into a string for AlbumView Display

createTag ( string name, string type ) : void

Used to insert tags into the DB

deselectFile ( int id ) : void

removes a file from the list of files set totalcount - 1

findInfinateParentLoop ( Folder testFolderIn ) : int
getFiles ( int userID ) : IList
getFolder ( int userID, int folderID ) : Folder

Returns the specific Folder, given the Folder ID and the User ID.

getFolder ( int userID, string folderID ) : Folder

The overloaded Get folder method.

getFolders ( int userID ) : IList

Returns all of the users owned folders in a List(folders)

getTag ( int id ) : Tags
getTagID ( string tag ) : int

Used to get the tags id via passed tag name

getUserByID ( int id ) : User

Gets the Users object via passed ID

insertImageToDB ( int Height, int Width, int FileSize, string FileName, string Tags, string Description, int FolderID ) : void

Uses all passed parimeters to create a new db image object, then pushes it into the db and saves

isSubfolder ( Folder subfolder, Folder parentFolder ) : int

Returns 1 if the subfolder is within the directory tree of the parent folder. Returns 0 if root folder . If the subfolder is in a nonconventional loop(root folder is missing), the return is -1.

moveFolder ( int userID, string folderToMoveID, int destinationFolderID ) : bool
moveFolder ( int userID, string folderToMoveID, string destinationFolderID ) : bool
selectFile ( int id ) : List

SelectFile(int) adds a file from the list of files set totalcount + 1

seperateTags ( string s ) : string[]

Seperate the string via ',' Replace , with space cut up string via spaces and store into array. return array.

비공개 메소드들

메소드 설명
HexByteArrayToHexString ( byte hexValues, string fileExtension ) : string

Converts a hexadecimal byte array into a filename string representing the hexadecimal bytes.

메소드 상세

CreateFilename() 공개 메소드

public CreateFilename ( int userid, string filename ) : string
userid int
filename string
리턴 string

CreateTagCloudOverlayContents() 공개 정적인 메소드

public static CreateTagCloudOverlayContents ( List tags ) : string
tags List
리턴 string

GetFilesFromFolder() 공개 메소드

public GetFilesFromFolder ( int folderID, int userId ) : IEnumerable
folderID int
userId int
리턴 IEnumerable

GetTop100Tags() 공개 정적인 메소드

Gets the 100 most used tags from the database.
public static GetTop100Tags ( IPAWAContext dbContext ) : List
dbContext IPAWAContext
리턴 List

GetUsers() 공개 메소드

Gets all users
public GetUsers ( ) : IEnumerable
리턴 IEnumerable

ImageResize() 공개 메소드

Take in image, create a new bitmap, bitmap size = newsize Render and clean image Apply image to bitmap Return the thumbnail
public ImageResize ( Image imgFile, Size newSize ) : Image
imgFile Image
newSize System.Drawing.Size
리턴 Image

PhotoValidation() 공개 메소드

Confirms that the file uploaded is not null and is a image of the required type.
public PhotoValidation ( System.Web.HttpPostedFileBase image ) : System.Boolean
image System.Web.HttpPostedFileBase
리턴 System.Boolean

TagUsedCountIncrease() 공개 메소드

Increase the selected tags usedcount in the database by 1 everytime this method is called
public TagUsedCountIncrease ( string tagName ) : void
tagName string
리턴 void

changeFolderName() 공개 메소드

public changeFolderName ( int userID, int folderID, string newFolderName ) : bool
userID int
folderID int
newFolderName string
리턴 bool

checkExtension() 공개 메소드

Checks the extension of the image and returns the correct format for saving
public checkExtension ( string file ) : System.Drawing.Imaging.ImageFormat
file string
리턴 System.Drawing.Imaging.ImageFormat

checkIfTagExists() 공개 메소드

Will used the passed array to compare against the DB, if the tag doesnt exist it will create it. returning all of the images tags IDs in a List(int)
public checkIfTagExists ( string TagArr ) : List
TagArr string
리턴 List

convertTagsToString() 공개 메소드

Combines all the tagIDs from a List into a string for AlbumView Display
public convertTagsToString ( List TagIDs ) : string
TagIDs List
리턴 string

createTag() 공개 메소드

Used to insert tags into the DB
public createTag ( string name, string type ) : void
name string
type string
리턴 void

deselectFile() 공개 메소드

removes a file from the list of files set totalcount - 1
public deselectFile ( int id ) : void
id int
리턴 void

findInfinateParentLoop() 공개 메소드

public findInfinateParentLoop ( Folder testFolderIn ) : int
testFolderIn PAWA.Models.Folder
리턴 int

getFiles() 공개 메소드

public getFiles ( int userID ) : IList
userID int
리턴 IList

getFolder() 공개 메소드

Returns the specific Folder, given the Folder ID and the User ID.
public getFolder ( int userID, int folderID ) : Folder
userID int ID of the user to witch the folder pertains.
folderID int ID of the folder that is being fetched.
리턴 PAWA.Models.Folder

getFolder() 공개 메소드

The overloaded Get folder method.
public getFolder ( int userID, string folderID ) : Folder
userID int ID of the user to witch the folder pertains.
folderID string ID of the folder that is being fetched.
리턴 PAWA.Models.Folder

getFolders() 공개 메소드

Returns all of the users owned folders in a List(folders)
public getFolders ( int userID ) : IList
userID int
리턴 IList

getTag() 공개 메소드

public getTag ( int id ) : Tags
id int
리턴 PAWA.Models.Tags

getTagID() 공개 메소드

Used to get the tags id via passed tag name
public getTagID ( string tag ) : int
tag string
리턴 int

getUserByID() 공개 메소드

Gets the Users object via passed ID
public getUserByID ( int id ) : User
id int
리턴 PAWA.Models.User

insertImageToDB() 공개 메소드

Uses all passed parimeters to create a new db image object, then pushes it into the db and saves
public insertImageToDB ( int Height, int Width, int FileSize, string FileName, string Tags, string Description, int FolderID ) : void
Height int
Width int
FileSize int
FileName string
Tags string
Description string
FolderID int
리턴 void

isSubfolder() 공개 메소드

Returns 1 if the subfolder is within the directory tree of the parent folder. Returns 0 if root folder . If the subfolder is in a nonconventional loop(root folder is missing), the return is -1.
public isSubfolder ( Folder subfolder, Folder parentFolder ) : int
subfolder PAWA.Models.Folder Folder that is presumed to be a child of the parent folder
parentFolder PAWA.Models.Folder folder that is persumed to contain the sub folder
리턴 int

moveFolder() 공개 메소드

public moveFolder ( int userID, string folderToMoveID, int destinationFolderID ) : bool
userID int
folderToMoveID string
destinationFolderID int
리턴 bool

moveFolder() 공개 메소드

public moveFolder ( int userID, string folderToMoveID, string destinationFolderID ) : bool
userID int
folderToMoveID string
destinationFolderID string
리턴 bool

selectFile() 공개 메소드

SelectFile(int) adds a file from the list of files set totalcount + 1
public selectFile ( int id ) : List
id int
리턴 List

seperateTags() 공개 메소드

Seperate the string via ',' Replace , with space cut up string via spaces and store into array. return array.
public seperateTags ( string s ) : string[]
s string
리턴 string[]