private void SetMessageText()
        {
            StringBuilder b = new StringBuilder();

            if (null == _messageText)
            {
                // Do not display any progress text when transfer is stopped
                Date timestamp = _transfer.getTimestamp();
                if (null != timestamp)
                {
                    _messageText = DateFormatterFactory.instance().getLongFormat(timestamp.getTime());
                }
            }
            if (null != _messageText)
            {
                b.Append(_messageText);
            }
            View.MessageText = b.ToString();
        }
示例#2
0
        private void View_ChangedSelectionEvent()
        {
            if (View.SelectedPath != null)
            {
                Path selected = View.SelectedPath.Unique;
                if (null != selected)
                {
                    View.LocalFileUrl = selected.getLocal().getAbsolute();
                    if (selected.getLocal().exists())
                    {
                        if (selected.getLocal().attributes().getSize() == -1)
                        {
                            View.LocalFileSize = UnknownString;
                        }
                        else
                        {
                            View.LocalFileSize = Status.getSizeAsString(selected.getLocal().attributes().getSize());
                        }
                        if (selected.getLocal().attributes().getModificationDate() == -1)
                        {
                            View.LocalFileModificationDate = UnknownString;
                        }
                        else
                        {
                            View.LocalFileModificationDate =
                                DateFormatterFactory.instance().getLongFormat(
                                    selected.getLocal().attributes().getModificationDate());
                        }
                    }
                    else
                    {
                        View.LocalFileSize             = String.Empty;
                        View.LocalFileModificationDate = String.Empty;
                    }

                    View.RemoteFileUrl = selected.getHost().toURL() + selected.getAbsolute();
                    if (selected.exists())
                    {
                        if (selected.attributes().getSize() == -1)
                        {
                            View.RemoteFileSize = UnknownString;
                        }
                        else
                        {
                            View.RemoteFileSize = Status.getSizeAsString(selected.attributes().getSize());
                        }
                        if (selected.attributes().getModificationDate() == -1)
                        {
                            View.RemoteFileModificationDate = UnknownString;
                        }
                        else
                        {
                            View.RemoteFileModificationDate =
                                DateFormatterFactory.instance().getLongFormat(
                                    selected.attributes().getModificationDate());
                        }
                    }
                    else
                    {
                        View.RemoteFileSize             = String.Empty;
                        View.RemoteFileModificationDate = String.Empty;
                    }
                }
                else
                {
                    View.LocalFileUrl              = String.Empty;
                    View.LocalFileSize             = String.Empty;
                    View.LocalFileModificationDate = String.Empty;
                }
            }
        }
示例#3
0
 public static void Register()
 {
     DateFormatterFactory.addFactory(ch.cyberduck.core.Factory.NATIVE_PLATFORM, new Factory());
 }