private void TransmissionUpdate(object sender, PropertyChangedEventArgs args) {
var t = sender as Transmission;
if (args.PropertyName == CmisSync.Lib.Utils.NameOf(() => t.BitsPerSecond)) {
Gtk.Application.Invoke(delegate {
this.bandwidthLabel.Markup = string.Format("<small>{0}</small>", CmisSync.Lib.Utils.FormatBandwidth(t.BitsPerSecond.GetValueOrDefault()));
this.UpdateSizeAndPositionStatus(t);
});
} else if (args.PropertyName == CmisSync.Lib.Utils.NameOf(() => t.LastModification)) {
Gtk.Application.Invoke(delegate {
this.lastModificationLabel.Markup = string.Format("<small>{0}</small>", t.LastModification.ToString());
});
} else if (args.PropertyName == CmisSync.Lib.Utils.NameOf(() => t.Length)) {
Gtk.Application.Invoke(delegate {
this.UpdateSizeAndPositionStatus(t);
});
} else if (args.PropertyName == CmisSync.Lib.Utils.NameOf(() => t.Percent)) {
var progress = t.Percent;
if (progress != null) {
Gtk.Application.Invoke(delegate {
this.Progress = progress.GetValueOrDefault() / 100;
});
}
} else if (args.PropertyName == CmisSync.Lib.Utils.NameOf(() => t.Status)) {
Gtk.Application.Invoke(delegate {
this.UpdateStatus(t.Status);
});
}
}