public TransmissionWindow() : base(Gtk.WindowType.Toplevel) {
this.Build();
this.HideOnDelete();
this.Title = Properties_Resources.Transmission;
this.controller.ShowWindowEvent += () => {
this.ShowAll();
};
this.controller.HideWindowEvent += () => {
this.Hide();
};
this.DeleteEvent += (o, args) => {
// Do not destroy the window, just hide it
args.RetVal = true;
this.Hide();
};
this.controller.InsertTransmissionEvent += (Transmission transmission) => {
Gtk.Application.Invoke(delegate {
var widget = new TransmissionWidget() { Transmission = transmission };
this.widgets.Add(transmission, widget);
this.transmissionList.PackStart(widget, false, true, 2);
this.transmissionList.ReorderChild(widget, 0);
this.transmissionList.Show();
});
};
this.controller.DeleteTransmissionEvent += (Transmission transmission) => {
Gtk.Application.Invoke(delegate {
var widget = widgets[transmission];
widgets.Remove(transmission);
this.transmissionList.Remove(widget);
this.transmissionList.Show();
});
};
}
}