本文整理汇总了C#中Song.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Song.Equals方法的具体用法?C# Song.Equals怎么用?C# Song.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Song
的用法示例。
在下文中一共展示了Song.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeSong
public virtual void ChangeSong(Song target)
{
ParamIs.NotNull(() => target);
if (target.Equals(Song))
return;
Song.ListLinks.Remove(this);
target.ListLinks.Add(this);
Song = target;
}
示例2: Move
public virtual void Move(Song target)
{
ParamIs.NotNull(() => target);
if (target.Equals(Song))
return;
Song.AllAlbums.Remove(this);
target.AllAlbums.Add(this);
Song = target;
}
示例3: Move
public virtual void Move(Song target) {
ParamIs.NotNull(() => target);
if (target.Equals(Song))
return;
if (Song == null)
throw new InvalidOperationException("Cannot move a track with no song to another song");
Song.AllAlbums.Remove(this);
target.AllAlbums.Add(this);
Song = target;
}
示例4: Play
public void Play(Song song)
{
Contract.Requires(song != null);
if (CurrentSong != null && song.Equals(CurrentSong))
{
Bass.BASS_ChannelPlay(_audioStream, true);
return;
}
if (_cancelToken != null)
{
_cancelToken.Cancel();
}
_currentSongID = song.SongID;
_currentSongPath = Path.Combine(MainCacheDirectory, _currentSongID + ".mp3");
CurrentSong = song;
if(Songs.Contains(song))
{
Songs.Move(Songs.IndexOf(song),Songs.Count-1);
}
else
{
Songs.Add(song);
}
Task.Factory.StartNew(StartStream, new Tuple<string, string>(_currentSongID, _currentSongPath));
}
示例5: Move
public virtual void Move(Song target)
{
ParamIs.NotNull(() => target);
if (target.Equals(Song))
return;
Song.UserFavorites.Remove(this);
target.UserFavorites.Add(this);
if (Rating == SongVoteRating.Favorite) {
Song.FavoritedTimes--;
target.FavoritedTimes++;
}
Song.RatingScore -= GetRatingScore(Rating);
target.RatingScore += GetRatingScore(Rating);
Song = target;
}