本文整理匯總了C#中Album.IsEqual方法的典型用法代碼示例。如果您正苦於以下問題:C# Album.IsEqual方法的具體用法?C# Album.IsEqual怎麽用?C# Album.IsEqual使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Album
的用法示例。
在下文中一共展示了Album.IsEqual方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetAlbums
public ArrayList GetAlbums()
{
lock (_albumlock) {
ArrayList albums = new ArrayList();
foreach (string setid in OrderedSetsList.Split(',')) {
Album a = GetAlbum(setid);
if (a != null) albums.Add(a);
}
// Now check for those albums which are not present in the ordered list.
IDbConnection dbcon = (IDbConnection) new SqliteConnection(DB_PATH);
dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
dbcmd.CommandText = "select * from album;";
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
string setid = reader.GetString(0);
string title = reader.GetString(1);
string desc = reader.GetString(2);
string photoid = reader.GetString(3);
Album album = new Album(setid, title, desc, photoid);
bool ispresent = false;
foreach (Album a in albums) {
if (album.IsEqual(a)) ispresent = true;
}
if (!ispresent) albums.Add(album);
}
// clean up
reader.Close();
dbcmd.Dispose();
dbcon.Close();
return albums;
}
}