本文整理汇总了C#中Playlist.append方法的典型用法代码示例。如果您正苦于以下问题:C# Playlist.append方法的具体用法?C# Playlist.append怎么用?C# Playlist.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist.append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: can_resolve_absolute_and_relative_positions
public void can_resolve_absolute_and_relative_positions()
{
sut = Builder.newPlaylist();
sut.append(ObjectMother.RandomAirplay());
sut.append(new Section());
sut.append(ObjectMother.RandomAirplay());
Assert.AreEqual(1, sut.getAirplayAt(1).RelativePosition);
Assert.AreEqual(1, sut.getAirplayAt(2).RelativePosition);
Assert.AreEqual(1, sut.getAirplayAt(1).Section.Position);
Assert.AreEqual(2, sut.getAirplayAt(2).Section.Position);
}
示例2: newPlaylist
// TODO: there is a hidden validity-rule here: Playlist must/will/should always have at least one Section
public static Playlist newPlaylist()
{
var p = new Playlist();
p.append(new Section());
return p;
}
示例3: can_move_Section
public void can_move_Section()
{
sut = Builder.newPlaylist("p1");
sut.getSectionAt(1).Name = "s1";
sut.append(new Section { Name = "s2" });
using(var s = sf.OpenSession())
using(var t = s.BeginTransaction()) {
s.Save(sut);
t.Commit();
}
using(var s = sf.OpenSession())
using(var t = s.BeginTransaction()) {
var p = s.Load<Playlist>(sut.Id);
p.moveSection(1, 2);
t.Commit();
}
using(var s = sf.OpenSession()) {
var playlists = s.Query<Playlist>().ToList();
Assert.AreEqual(1, playlists.Count);
Assert.AreEqual("s2", playlists.Single().getSectionAt(1).Name);
Assert.AreEqual("s1", playlists.Single().getSectionAt(2).Name);
}
}
示例4: sup
public void sup()
{
sut = Builder.newPlaylist("p1");
//sut.getSectionAt(1).Name = "s1";
var iteration = 1;
while(sut.Airplays.Count() < 5) {
sut.append(ObjectMother.RandomAirplay("t" + iteration));
iteration++;
}
}