public override void message(string message) { string text; if (Utils.IsBlank(message)) { // Do not display any progress text when transfer is stopped Date timestamp = _transfer.getTimestamp(); if (null != timestamp) { text = UserDateFormatterFactory.get().getLongFormat(timestamp.getTime()); } else { text = String.Empty; } } else { text = message; } AsyncDelegate d = () => View.MessageText = text; invoke(new SimpleDefaultMainAction(this, d)); }
private void View_ChangedSelectionEvent() { if (View.SelectedItem != null) { TransferItem selected = View.SelectedItem; if (null != selected) { if (null != selected.local) { View.LocalFileUrl = selected.local.getAbsolute(); if (selected.local.attributes().getSize() == -1) { View.LocalFileSize = UnknownString; } else { View.LocalFileSize = SizeFormatterFactory.get().format(selected.local.attributes().getSize()); } if (selected.local.attributes().getModificationDate() == -1) { View.LocalFileModificationDate = UnknownString; } else { View.LocalFileModificationDate = UserDateFormatterFactory.get().getLongFormat(selected.local.attributes().getModificationDate()); } } View.RemoteFileUrl = new DefaultUrlProvider(Transfer.getSource()).toUrl(selected.remote) .find(DescriptiveUrl.Type.provider) .getUrl(); TransferStatus status = TransferPromptModel.GetStatus(selected); if (status.getRemote().getSize() == -1) { View.RemoteFileSize = UnknownString; } else { View.RemoteFileSize = SizeFormatterFactory.get().format(status.getRemote().getSize()); } if (status.getRemote().getModificationDate() == -1) { View.RemoteFileModificationDate = UnknownString; } else { View.RemoteFileModificationDate = UserDateFormatterFactory.get().getLongFormat(status.getRemote().getModificationDate()); } } else { View.LocalFileUrl = String.Empty; View.LocalFileSize = String.Empty; View.LocalFileModificationDate = String.Empty; } } }
public string GetModifiedAsString(object value) { long modificationDate = (long)value; if (modificationDate != -1) { return (UserDateFormatterFactory.get() .getShortFormat(modificationDate, PreferencesFactory.get().getBoolean("browser.date.natural"))); } return(_unknown); }
public string GetModifiedAsString(object value) { DateTime modificationDate = (DateTime)value; if (modificationDate != DateTime.MinValue) { return (UserDateFormatterFactory.get() .getShortFormat(UserDefaultsDateFormatter.ConvertDateTimeToJavaMilliseconds(modificationDate), PreferencesFactory.get().getBoolean("browser.date.natural"))); } return(_unknown); }