public static void update(Int64 playlistId, Airplay Airplay, Int32 Position, Int32 OldPosition) { if (Math.Abs(Position - OldPosition) < 2) { return; } IPlaylistDao pdao = new DaoFactory().getPlaylistDao(); Playlist p = pdao.GetById(playlistId, false); p.biDeassociateAt(OldPosition); p.biAssociateAt(Airplay, Position); pdao.CommitTransactionFlush(); }
public static void Main() { RaopServer server = new RaopServer(5000); Airplay notifier = new Airplay(5000); server.StartTcp(); notifier.Publish(); Console.Read(); notifier.Stop(); server.Stop(); }
static void appendAfterTarget(Airplay from, Airplay to) { // wire from and to's successor, if any if(null != to.Next) to.Next.Previous = from; from.Next = to.Next; // wire from and to from.Previous = to; to.Next = from; }
public AirplayDto(Airplay airplay, Int32 listIndex) { Airplay = airplay; OldPosition = Position = listIndex + 1; }
public override void sup() { base.sup(); sut = ObjectMother.RandomAirplay(); }
static void insertBeforTarget(Airplay from, Airplay to) { // wire from and to's predecessor if(null != to.Previous) to.Previous.Next = from; from.Previous = to.Previous; // wire from and to from.Next = to; to.Previous = from; }
public AirplayVm(Airplay a) { Raw = a.nn(); }
public void Save_persistentSong() { String schema = @" insert into Artist values(1, 'w'); insert into Code values(1, 'c'); insert into Playtime values(1, 20000000); insert into Publisher values(1, 'pu'); insert into Title values(1, 's'); insert into Writer values(1, 'w'); insert into Song(Id, WriterId, CodeId, ArtistId, TitleId, PublisherId, PlaytimeId) values(1,1,1,1,1,1,1); "; new SQLiteCommand(schema, SqliteConn).ExecuteNonQuery(); ISongDao sdao = new DaoFactory().getSongDao(); Song s = sdao.GetById(1L, false); Airplay a = new Airplay(s); a = dao.Save(a); dao.CommitTransactionFlush(); Assert.IsTrue(a.Id > 0); }
public void Save_transientSong() { Song s = new Song( new Artist(Guid.NewGuid().ToString()) , new Code(Guid.NewGuid().ToString()) , new Playtime(new TimeSpan(0, new Random().Next(1, 15), new Random().Next(0, 59))) // 1:00 min <= x <= 14:59 min , new Publisher(Guid.NewGuid().ToString()) , new Title(Guid.NewGuid().ToString()) , new Writer(Guid.NewGuid().ToString()) ); Airplay a = new Airplay(s); a = dao.Save(a); dao.CommitTransactionFlush(); Assert.IsTrue(a.Id > 0); }
public void sup() { sut = ObjectMother.RandomAirplay(); }
public void biAssociate_persistent_Airplay2() { Song s = new Song( new Artist(Guid.NewGuid().ToString()) , new Code(Guid.NewGuid().ToString()) , new Playtime(new TimeSpan(0, new Random().Next(1, 15), new Random().Next(0, 59))) // 1:00 min <= x <= 14:59 min , new Publisher(Guid.NewGuid().ToString()) , new Title(Guid.NewGuid().ToString()) , new Writer(Guid.NewGuid().ToString()) ); Airplay a = new Airplay(s); Playlist p = dao.Save(new Playlist("p")); p.biAssociate(a); daoFactory.getAirplayDao().Save(a); dao.CommitTransactionFlush(); }
public void setUp() { Song s = new Song( new Artist(Guid.NewGuid().ToString()) , new Code(Guid.NewGuid().ToString()) , new Playtime(new TimeSpan(0, new Random().Next(1, 15), new Random().Next(0, 60))) // 1:00 min <= x <= 14:59 min , new Publisher(Guid.NewGuid().ToString()) , new Title(Guid.NewGuid().ToString()) , new Writer(Guid.NewGuid().ToString()) ); a1 = new Airplay(s); a2 = new Airplay(a1.Song); }
public override void setUp() { pdao = daoFactory.getPlaylistDao(); adao = daoFactory.getAirplayDao(); p1 = pdao.GetById(1L, false); p2 = pdao.GetById(2L, false); ap1 = adao.GetById(1L, false); ap2 = adao.GetById(2L, false); base.setUp(); }