Class TagCommand

Definition

Namespace:
Tizen.Content.MediaContent
Assembly:
Tizen.Content.MediaContent.dll
API Level:
4

Provides the commands to manage tags in the database.

C#
Copy
public class TagCommand : MediaCommand
Inheritance
TagCommand

Constructors

View Source

TagCommand(MediaDatabase)

Initializes a new instance of the TagCommand class with the specified MediaDatabase.

Declaration
C#
Copy
public TagCommand(MediaDatabase database)
Parameters
Type Name Description
MediaDatabase database

The MediaDatabase that the commands run on.

Exceptions
Type Condition
ArgumentNullException

database is null.

ObjectDisposedException

database has already been disposed of.

API Level: 4

Methods

View Source

AddMedia(Int32, IEnumerable<String>)

Adds the media set to a tag.

Declaration
C#
Copy
public bool AddMedia(int tagId, IEnumerable<string> mediaIds)
Parameters
Type Name Description
System.Int32 tagId

The tag ID that the media will be added to.

System.Collections.Generic.IEnumerable<System.String> mediaIds

The media ID to add to the tag.

Returns
Type Description
Boolean

true if the matched record was found and updated, otherwise false.

Remarks

The invalid media IDs will be ignored.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

mediaIds is null.

System.ArgumentException

mediaIds has no element.
-or-
mediaIds contains null value.
-or-
mediaIds contains a zero-length string, contains only white space.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

AddMedia(Int32, String)

Adds the media to a tag.

Declaration
C#
Copy
public bool AddMedia(int tagId, string mediaId)
Parameters
Type Name Description
System.Int32 tagId

The tag ID that the media will be added to.

System.String mediaId

The media ID to add to the tag.

Returns
Type Description
Boolean

true if the matched record was found and updated, otherwise false.

Remarks

The invalid media ID will be ignored.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

mediaId is null.

System.ArgumentException

mediaId is a zero-length string, contains only white space.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

Count()

Retrieves the number of tags.

Declaration
C#
Copy
public int Count()
Returns
Type Description
System.Int32

The number of tags.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

Count(CountArguments)

Retrieves the number of tags with the CountArguments.

Declaration
C#
Copy
public int Count(CountArguments arguments)
Parameters
Type Name Description
CountArguments arguments

The criteria to use to filter. This value can be null.

Returns
Type Description
System.Int32

The number of tags filtered.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

CountMedia(Int32)

Retrieves the number of media info of the tag.

Declaration
C#
Copy
public int CountMedia(int tagId)
Parameters
Type Name Description
System.Int32 tagId

The tag ID.

Returns
Type Description
System.Int32

The number of the media information.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

CountMedia(Int32, CountArguments)

Retrieves the number of the media information of the tag with the CountArguments.

Declaration
C#
Copy
public int CountMedia(int tagId, CountArguments arguments)
Parameters
Type Name Description
System.Int32 tagId

The tag ID to query with.

CountArguments arguments

The criteria to use to filter. This value can be null.

Returns
Type Description
System.Int32

The number of the media information.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

Delete(Int32)

Deletes a tag from the database.

Declaration
C#
Copy
public bool Delete(int tagId)
Parameters
Type Name Description
System.Int32 tagId

The tag ID to delete.

Returns
Type Description
Boolean

true if the matched record was found and deleted, otherwise false.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

UnauthorizedAccessException

The caller has no required privilege.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View Source

Insert(String)

Inserts a tag into the database with the specified name.

Declaration
C#
Copy
public Tag Insert(string name)
Parameters
Type Name Description
System.String name

The name of tag.

Returns
Type Description
Tag

The Tag instance that contains the record information inserted.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

name is null.

UnauthorizedAccessException

The caller has no required privilege.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write
View Source

RemoveMedia(Int32, IEnumerable<String>)

Removes the media set from a tag.

Declaration
C#
Copy
public bool RemoveMedia(int tagId, IEnumerable<string> mediaIds)
Parameters
Type Name Description
System.Int32 tagId

The tag ID.

System.Collections.Generic.IEnumerable<System.String> mediaIds

The collection of media ID to remove from the tag.

Returns
Type Description
Boolean

true if the matched record was found and updated, otherwise false.

Remarks

The invalid IDs will be ignored.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

mediaIds is null.

System.ArgumentException

mediaIds has no element.
-or-
mediaIds contains null value.
-or-
mediaIds contains a zero-length string or white space.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

RemoveMedia(Int32, String)

Removes the media from a tag.

Declaration
C#
Copy
public bool RemoveMedia(int tagId, string mediaId)
Parameters
Type Name Description
System.Int32 tagId

The tag ID.

System.String mediaId

The media ID to remove from the tag.

Returns
Type Description
Boolean

true if the matched record was found and updated, otherwise false.

Remarks

The invalid media ID will be ignored.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

mediaId is null.

System.ArgumentException

mediaId is a zero-length string, contains only white space.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

Select()

Retrieves all the tags.

Declaration
C#
Copy
public MediaDataReader<Tag> Select()
Returns
Type Description
MediaDataReader<Tag>

The MediaDataReader<TRecord> containing the results.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

Select(Int32)

Retrieves the tag with the specified ID.

Declaration
C#
Copy
public Tag Select(int tagId)
Parameters
Type Name Description
System.Int32 tagId

The tag ID to select.

Returns
Type Description
Tag

The Tag instance if the matched record was found in the database, otherwise null.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

Select(SelectArguments)

Retrieves the tags with the SelectArguments.

Declaration
C#
Copy
public MediaDataReader<Tag> Select(SelectArguments arguments)
Parameters
Type Name Description
SelectArguments arguments

The criteria to use to filter. This value can be null.

Returns
Type Description
MediaDataReader<Tag>

The MediaDataReader<TRecord> containing the results.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

API Level: 4
View Source

SelectMedia(Int32)

Retrieves the media information of the tag.

Declaration
C#
Copy
public MediaDataReader<MediaInfo> SelectMedia(int tagId)
Parameters
Type Name Description
System.Int32 tagId

The tag ID.

Returns
Type Description
MediaDataReader<MediaInfo>

The MediaDataReader<TRecord> containing the results.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

SelectMedia(Int32, SelectArguments)

Retrieves the media information of the tag with the SelectArguments.

Declaration
C#
Copy
public MediaDataReader<MediaInfo> SelectMedia(int tagId, SelectArguments filter)
Parameters
Type Name Description
System.Int32 tagId

The tag ID.

SelectArguments filter

The criteria to use to filter. This value can be null.

Returns
Type Description
MediaDataReader<MediaInfo>

The MediaDataReader<TRecord> containing the results.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

API Level: 4
View Source

UpdateName(Int32, String)

Updates a tag with the specified name.

Declaration
C#
Copy
public bool UpdateName(int tagId, string name)
Parameters
Type Name Description
System.Int32 tagId

The tag ID to update.

System.String name

The new name.

Returns
Type Description
Boolean

true if the matched record was found and updated, otherwise false.

Exceptions
Type Condition
InvalidOperationException

The MediaDatabase is disconnected.

ObjectDisposedException

The MediaDatabase has already been disposed of.

MediaDatabaseException

An error occurred while executing the command.

ArgumentNullException

name is null.

ArgumentOutOfRangeException

tagId is less than or equal to zero.

UnauthorizedAccessException

The caller has no required privilege.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/content.write

See Also