本文整理汇总了C#中Library.addGenre方法的典型用法代码示例。如果您正苦于以下问题:C# Library.addGenre方法的具体用法?C# Library.addGenre怎么用?C# Library.addGenre使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library.addGenre方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
//.........这里部分代码省略.........
switch (which_command)
{
case CLEAR_CACHE:
opResult.StatusCode = OpStatusCode.Ok;
clear_cache();
return opResult;
case LIST_GENRES:
if (create_playlist_name != null)
{
IWMPPlaylist genre_playlist = collection.getPlaylistByQuery(query, "Audio", "WM/Genre", true);
add_to_playlist(opResult, has_query, genre_playlist, create_playlist_name);
opResult.StatusCode = OpStatusCode.Ok;
}
else
{
IWMPStringCollection genres;
if (has_query)
{
genres = collection.getStringCollectionByQuery("WM/Genre", query, "Audio", "WM/Genre", true);
}
else
{
genres = collection.getAttributeStringCollection("WM/Genre", "Audio");
}
if (genres != null && genres.count > 0)
{
result_count = 0;
for (int k = 0; k < genres.count; k++)
{
string item = genres.Item(k);
if (item != null && !item.Equals(""))
{
if (!m_stats_only) metadata.addGenre(item);
else result_count++;
}
}
opResult.ResultCount = result_count;
metadata.trimToSize();
opResult = serializeObject(opResult, metadata, cache_fn, cache_ver);
}
else
{
opResult.StatusCode = OpStatusCode.BadRequest;
opResult.StatusText = "No genres found!";
}
}
return opResult;
case LIST_ARTISTS:
if (create_playlist_name != null)
{
IWMPPlaylist artists_playlist = collection.getPlaylistByQuery(query, "Audio", "Author", true);
add_to_playlist(opResult, has_query, artists_playlist, create_playlist_name);
opResult.StatusCode = OpStatusCode.Ok;
}
else
{
IWMPStringCollection artists;
if (has_query)
{
artists = collection.getStringCollectionByQuery("Author", query, "Audio", "Author", true);
}
else
{
artists = collection.getAttributeStringCollection("Author", "Audio");
}