4
using System.Collections.Generic;
10
namespace Transmission {
12
public class TorrentStartAction: Act {
14
public TorrentStartAction() {
17
public override string Name {
18
get { return AddinManager.CurrentLocalizer.GetString ("Start"); }
21
public override string Description {
22
get { return AddinManager.CurrentLocalizer.GetString ("Start downloading torrent"); }
25
public override string Icon {
26
get { return "gtk-media-play"; }
29
public override IEnumerable<Type> SupportedItemTypes {
30
get { yield return typeof (TorrentItem); }
33
public override IEnumerable<Item> Perform(IEnumerable<Item> items, IEnumerable<Item> modItems) {
34
TransmissionAPI api = TransmissionPlugin.getTransmission();
36
var hashes = items.Cast<TorrentItem>().Select(t => t.HashString);
37
api.StartTorrents(hashes);