本文整理汇总了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;
}
}