C# Class afung.MangaWeb3.Server.Collection

The Collection class
Datei anzeigen Open project: a-fung/MangaWeb3 Class Usage Examples

Public Methods

Method Description
Accessible ( AjaxBase ajax ) : bool

Get whether the current request can access the collection

CheckNewCollectionName ( string name ) : bool

Check whether a name can be used for creating a new collection

CheckNewCollectionPath ( string path ) : string

Check whether a path can be used for creating a new collection

CreateNewCollection ( string name, string path, bool public_, bool autoadd ) : Collection

Create a new collection

DeleteCollections ( int ids ) : void

Delete collections and all associated data from database

GetAccessible ( AjaxBase ajax ) : afung.MangaWeb3.Server.Collection[]

Get a list of collections from database which is accessible by the current user

GetAllCollectionNames ( ) : string[]

Get the names of all the collections from database

GetAllCollections ( ) : afung.MangaWeb3.Server.Collection[]

Get all collections from database

GetAutoAdd ( ) : afung.MangaWeb3.Server.Collection[]

Get a list of collections from database which uses auto add

GetById ( int id ) : Collection

Get a collection from database by ID

GetByName ( string name ) : Collection

Get a collection from database by name

MarkFolderCacheDirty ( ) : void

Mark Folder Cache Dirty

ProcessFolderCache ( ) : void

Process folder cache and save it in database

Save ( ) : void

Save the collection to database

SetCollectionsPublic ( int ids, bool public_ ) : void

Set collections to be public/private

ToJson ( ) : CollectionJson

Get an object to be stringified and passed to client app

ToJsonArray ( Collection collections ) : afung.MangaWeb3.Common.CollectionJson[]

Get an array of CollectionJson to be passed to client app

Private Methods

Method Description
Collection ( ) : System

Instantiate a new instance of Collection class

FromData ( object>.Dictionary data ) : Collection

Create a new instance of Collection using data from database

Method Details

Accessible() public method

Get whether the current request can access the collection
public Accessible ( AjaxBase ajax ) : bool
ajax AjaxBase The AjaxBase object which received the request
return bool

CheckNewCollectionName() public static method

Check whether a name can be used for creating a new collection
public static CheckNewCollectionName ( string name ) : bool
name string The name
return bool

CheckNewCollectionPath() public static method

Check whether a path can be used for creating a new collection
public static CheckNewCollectionPath ( string path ) : string
path string
return string

CreateNewCollection() public static method

Create a new collection
public static CreateNewCollection ( string name, string path, bool public_, bool autoadd ) : Collection
name string The collection name
path string The collection path
public_ bool Whether the collection is public
autoadd bool Whether the collection uses auto add
return Collection

DeleteCollections() public static method

Delete collections and all associated data from database
public static DeleteCollections ( int ids ) : void
ids int A list of collection IDs
return void

GetAccessible() public static method

Get a list of collections from database which is accessible by the current user
public static GetAccessible ( AjaxBase ajax ) : afung.MangaWeb3.Server.Collection[]
ajax AjaxBase The AjaxBase object which received the request
return afung.MangaWeb3.Server.Collection[]

GetAllCollectionNames() public static method

Get the names of all the collections from database
public static GetAllCollectionNames ( ) : string[]
return string[]

GetAllCollections() public static method

Get all collections from database
public static GetAllCollections ( ) : afung.MangaWeb3.Server.Collection[]
return afung.MangaWeb3.Server.Collection[]

GetAutoAdd() public static method

Get a list of collections from database which uses auto add
public static GetAutoAdd ( ) : afung.MangaWeb3.Server.Collection[]
return afung.MangaWeb3.Server.Collection[]

GetById() public static method

Get a collection from database by ID
public static GetById ( int id ) : Collection
id int
return Collection

GetByName() public static method

Get a collection from database by name
public static GetByName ( string name ) : Collection
name string The name
return Collection

MarkFolderCacheDirty() public method

Mark Folder Cache Dirty
public MarkFolderCacheDirty ( ) : void
return void

ProcessFolderCache() public method

Process folder cache and save it in database
public ProcessFolderCache ( ) : void
return void

Save() public method

Save the collection to database
public Save ( ) : void
return void

SetCollectionsPublic() public static method

Set collections to be public/private
public static SetCollectionsPublic ( int ids, bool public_ ) : void
ids int A list of collection IDs
public_ bool Whether is public or private
return void

ToJson() public method

Get an object to be stringified and passed to client app
public ToJson ( ) : CollectionJson
return afung.MangaWeb3.Common.CollectionJson

ToJsonArray() public static method

Get an array of CollectionJson to be passed to client app
public static ToJsonArray ( Collection collections ) : afung.MangaWeb3.Common.CollectionJson[]
collections Collection An array of collections
return afung.MangaWeb3.Common.CollectionJson[]