예제 #1
0
 public TorrentViewModel(Torrent torrentModel, UTorrentClient client)
 {
     _torrentModel = torrentModel;
     //_client = client;
     _savePath = PathManager.GetTorrentPathForEpisode(_torrentModel.Episode);
     State = TorrentManager.CreateTorrentState(torrentModel);
 }
예제 #2
0
 public void RemoveTorrent(Torrent torrent)
 {
     if (torrent.EntityState != EntityState.Detached)
     _databaseEntities.DeleteObject(torrent);
 }
예제 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Torrents EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTorrents(Torrent torrent)
 {
     base.AddObject("Torrents", torrent);
 }
예제 #4
0
 /// <summary>
 /// Create a new Torrent object.
 /// </summary>
 /// <param name="torrentId">Initial value of the TorrentId property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="episodeId">Initial value of the EpisodeId property.</param>
 public static Torrent CreateTorrent(global::System.Int64 torrentId, global::System.String title, global::System.Int64 episodeId)
 {
     Torrent torrent = new Torrent();
     torrent.TorrentId = torrentId;
     torrent.Title = title;
     torrent.EpisodeId = episodeId;
     return torrent;
 }