本文整理汇总了C#中Track.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Track.Equals方法的具体用法?C# Track.Equals怎么用?C# Track.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayOrResume
void PlayOrResume(Track track)
{
if (track == null) throw new ArgumentNullException("track");
if (!CanPlay(track)) return;
if (!track.Equals(CurrentTrack))
{
Stop();
try
{
naudio.OpenFile(track.Filename);
}
catch (Exception e)
{
Log.WarnFormat("Unable to play {0}.", track.Filename);
Log.Warn(e);
return;
}
CurrentTrack = track;
messenger.SendToUI(new PlayerLoadedEvent(track));
}
naudio.Play();
}
示例2: TrackEqual_NullOtherTrack_ReturnFalse_Test
public void TrackEqual_NullOtherTrack_ReturnFalse_Test()
{
Track track1 = new Track { Id = 1 };
var result = track1.Equals(null);
Assert.IsNotNull(result);
Assert.IsFalse(result);
}
示例3: TrackEqual_UnequalTracks_ReturnFalse_Test
public void TrackEqual_UnequalTracks_ReturnFalse_Test()
{
Track track1 = new Track { Id = 1 };
Track track2 = new Track { Id = 2 };
var result = track1.Equals(track2);
Assert.IsNotNull(result);
Assert.IsFalse(result);
}
示例4: TrackEqual_EqualTracks_ReturnTrue_Test
public void TrackEqual_EqualTracks_ReturnTrue_Test()
{
Track track1 = new Track {Id = 1};
Track track2 = new Track { Id = 1 };
var result = track1.Equals(track2);
Assert.NotNull(result);
Assert.True(result);
}
示例5: IsPlaying
public bool IsPlaying(Track track)
{
if (track == null) throw new ArgumentNullException("track");
return track.Equals(CurrentTrack)
&& naudio.IsPlaying;
}