Inheritance: java.lang.Object, java.io.Serializable, java.lang.Cloneable
示例#1
0
        private Date GetDate(Calendar cal)
        {
            java.util.TimeZone timeZone = java.util.TimeZone.getTimeZone("GMT");
            if (cal == null)
            {
                cal = Calendar.getInstance();
            }
            cal.setTimeZone(timeZone);
            Date time = cal.getTime();

            time.setHours(cal.@get(11));
            return(time);
        }
示例#2
0
        private Properties initializeDefaults()
        {
            Properties defaults = new Properties();

            java.util.TimeZone tz = java.util.Calendar.getInstance().getTimeZone();
            if (tz != null)
            {
                defaults.setProperty(AVKey.INITIAL_LONGITUDE,
                                     System.Double.ToString(
                                         Angle.fromDegrees(180.0 * tz.getOffset(System.currentTimeMillis()) / (12.0 * 3.6e6)).degrees));
            }
            return(defaults);
        }
示例#3
0
        /// <summary>
        /// Converts a Java Date value to a UTC DateTime value
        /// </summary>
        /// <param name="utcDateTime">The UTC DateTime value</param>
        /// <returns>A UTC Java Date value</returns>
        private static Date ToJavaDateUtc(DateTime utcDateTime)
        {
            var cal = Calendar.getInstance();

            cal.setTimeZone(TimeZone.getTimeZone("UTC"));

            cal.set(Calendar.YEAR, utcDateTime.Year);
            cal.set(Calendar.MONTH, utcDateTime.Month - 1);
            cal.set(Calendar.DAY_OF_MONTH, utcDateTime.Day);
            cal.set(Calendar.HOUR_OF_DAY, utcDateTime.Hour);
            cal.set(Calendar.MINUTE, utcDateTime.Minute);
            cal.set(Calendar.SECOND, utcDateTime.Second);

            return(cal.getTime());
        }
示例#4
0
        /// <summary>
        /// Converts a Java Date value to a UTC DateTime value
        /// </summary>
        /// <param name="javaDate">The Java date</param>
        /// <returns>A UTC DateTime value</returns>
        private static DateTime FromJavaDateUtc(Date javaDate)
        {
            var cal = Calendar.getInstance();

            cal.setTimeZone(TimeZone.getTimeZone("UTC"));
            cal.setTime(javaDate);

            // note that the Month component of java.util.Date
            // from 0-11 (i.e. Jan == 0)
            return(new DateTime(cal.get(Calendar.YEAR),
                                cal.get(Calendar.MONTH) + 1,
                                cal.get(Calendar.DAY_OF_MONTH),
                                cal.get(Calendar.HOUR_OF_DAY),
                                cal.get(Calendar.MINUTE),
                                cal.get(Calendar.SECOND)));
        }
示例#5
0
        private void View_ChangedTimezoneEvent()
        {
            string selected = View.SelectedTimezone;

            string[] ids = TimeZone.getAvailableIDs();
            foreach (string id in ids)
            {
                TimeZone tz;
                if ((tz = TimeZone.getTimeZone(id)).getID().Equals(selected))
                {
                    _host.setTimezone(tz);
                    break;
                }
            }

            ItemChanged();
        }
示例#6
0
        private void InitTimezones()
        {
            List <string> timezones = new List <string> {
                UTC.getID()
            };

            string[] allTimezones = TimeZone.getAvailableIDs();
            Array.Sort(allTimezones);

            foreach (string timezone in allTimezones)
            {
                if (Regex.IsMatch(timezone, TimezoneIdPrefixes))
                {
                    timezones.Add(TimeZone.getTimeZone(timezone).getID());
                }
            }

            View.PopulateTimezones(timezones);
        }
示例#7
0
 /// <summary>
 /// Returns true if this zone has the same rule and offset as another zone.
 /// </summary>
 public bool hasSameRules(TimeZone other)
 {
     return default(bool);
 }
示例#8
0
        private void DoMetadata()
        {
            java.util.TimeZone timeZone = java.util.TimeZone.getTimeZone("GMT");
            Calendar           instance = Calendar.getInstance();

            instance.setTimeZone(timeZone);
            PDDocumentInformation documentInformation = this.doc.getDocumentInformation();

            documentInformation.setModificationDate(instance);
            if (documentInformation.getAuthor() == null)
            {
                documentInformation.setAuthor("Aquaforest");
            }
            if ((string.IsNullOrEmpty(documentInformation.getProducer()) ? true : documentInformation.getProducer() == " "))
            {
                documentInformation.setProducer("Aquaforest PDFA - http://www.aquaforest.com");
            }
            if (documentInformation.getKeywords() == null)
            {
                documentInformation.setKeywords("");
            }
            documentInformation.getCreationDate();
            instance.setTime(this.GetDate(documentInformation.getCreationDate()));
            documentInformation.setCreationDate(instance);
            this.doc.setDocumentInformation(documentInformation);
            this.doc.save(this.tempFileName);
            documentInformation = this.doc.getDocumentInformation();
            PDDocumentCatalog documentCatalog = this.doc.getDocumentCatalog();
            XMPMetadata       xMPMetadatum    = XMPMetadata.createXMPMetadata();

            if (this.ConformanceLevel.Trim().ToLower() == "a")
            {
                PDMarkInfo pDMarkInfo = new PDMarkInfo();
                pDMarkInfo.setMarked(true);
                documentCatalog.setMarkInfo(pDMarkInfo);
            }
            PDFAIdentificationSchema pDFAIdentificationSchema = xMPMetadatum.createAndAddPFAIdentificationSchema();

            pDFAIdentificationSchema.setConformance(this.ConformanceLevel);
            pDFAIdentificationSchema.setPart(new Integer(this.pdfaversion));
            DublinCoreSchema dublinCoreSchema = xMPMetadatum.createAndAddDublinCoreSchema();
            string           title            = documentInformation.getTitle();

            if (title != null)
            {
                dublinCoreSchema.setTitle(title);
            }
            title = documentInformation.getSubject();
            if (title != null)
            {
                dublinCoreSchema.setDescription(title);
            }
            title = documentInformation.getAuthor();
            if (title != null)
            {
                dublinCoreSchema.addCreator(title);
            }
            AdobePDFSchema adobePDFSchema = xMPMetadatum.createAndAddAdobePDFSchema();

            title = documentInformation.getProducer();
            if (title != null)
            {
                adobePDFSchema.setProducer(title);
            }
            title = documentInformation.getKeywords();
            if (title != null)
            {
                adobePDFSchema.setKeywords(title);
            }
            XMPBasicSchema xMPBasicSchema = xMPMetadatum.createAndAddXMPBasicSchema();

            title = documentInformation.getCreator();
            if (title != null)
            {
                xMPBasicSchema.setCreatorTool(title);
            }
            if (documentInformation.getCreationDate() != null)
            {
                xMPBasicSchema.setCreateDate(documentInformation.getCreationDate());
            }
            if (documentInformation.getModificationDate() != null)
            {
                xMPBasicSchema.setModifyDate(documentInformation.getModificationDate());
            }
            xMPBasicSchema.setMetadataDate(new GregorianCalendar());
            XmpSerializer          xmpSerializer          = new XmpSerializer();
            ByteArrayOutputStream  byteArrayOutputStream  = new ByteArrayOutputStream();
            SAXParserFactoryImpl   sAXParserFactoryImpl   = new SAXParserFactoryImpl();
            TransformerFactoryImpl transformerFactoryImpl = new TransformerFactoryImpl();

            xmpSerializer.serialize(xMPMetadatum, byteArrayOutputStream, false);
            PDMetadata pDMetadatum = new PDMetadata(this.doc);

            pDMetadatum.importXMPMetadata(byteArrayOutputStream.toByteArray());
            documentCatalog.setMetadata(pDMetadatum);
            this.doc.save(this.tempFileName);
            documentInformation = this.doc.getDocumentInformation();
        }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JavaTimeZone"/> class.
 /// </summary>
 public JavaTimeZone()
 {
     timeZone = java.util.TimeZone.getDefault();
 }
示例#10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JavaTimeZone"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 public JavaTimeZone(string name)
 {
     timeZone = java.util.TimeZone.getTimeZone(name);
 }
示例#11
0
		/// <summary>
		/// Sets the time zone with the given time zone value.
		/// </summary>
		public void setTimeZone(TimeZone value)
		{
		}
示例#12
0
 /// <summary>
 /// Gets a calendar with the specified time zone and locale.
 /// </summary>
 public static Calendar getInstance(TimeZone zone, Locale aLocale)
 {
     return(default(Calendar));
 }
示例#13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JavaTimeZone"/> class.
 /// </summary>
 public JavaTimeZone()
 {
     timeZone = java.util.TimeZone.getDefault();
 }
示例#14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JavaTimeZone"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 public JavaTimeZone(string name)
 {
     timeZone = java.util.TimeZone.getTimeZone(name);
 }
示例#15
0
 /// <summary>
 /// Sets the <code>TimeZone</code> that is returned by the <code>getDefault</code> method.
 /// </summary>
 public static void setDefault(TimeZone zone)
 {
 }
示例#16
0
 /// <summary>
 /// Sets the time zone with the given time zone value.
 /// </summary>
 public void setTimeZone(TimeZone value)
 {
 }
示例#17
0
 /// <summary>
 /// Sets the time zone for the calendar of this DateFormat object.
 /// </summary>
 public void setTimeZone(TimeZone zone)
 {
 }
示例#18
0
        protected virtual void Update()
        {
            View.WindowTitle      = BookmarkNameProvider.toString(_host);
            View.Hostname         = _host.getHostname();
            View.HostFieldEnabled = _host.getProtocol().isHostnameConfigurable();
            View.Nickname         = BookmarkNameProvider.toString(_host);
            View.DownloadFolder   = new DownloadDirectoryFinder().find(_host).getAbsolute();
            View.URL                     = new HostUrlProvider(true, true).get(_host);
            View.Port                    = _host.getPort().ToString();
            View.PortFieldEnabled        = _host.getProtocol().isPortConfigurable();
            View.PathFieldEnabled        = _host.getProtocol().isPathConfigurable();
            View.Path                    = _host.getDefaultPath();
            View.Username                = _host.getCredentials().getUsername();
            View.UsernameEnabled         = _options.user() && !_host.getCredentials().isAnonymousLogin();
            View.UsernameLabel           = $"{_host.getProtocol().getUsernamePlaceholder()}:";
            View.Password                = _host.getCredentials().getPassword();
            View.PasswordLabel           = $"{_options.getPasswordPlaceholder()}:";
            View.PasswordEnabled         = _options.password() && !_host.getCredentials().isAnonymousLogin();
            View.AnonymousEnabled        = _options.anonymous();
            View.AnonymousChecked        = _host.getCredentials().isAnonymousLogin();
            View.SelectedProtocol        = _host.getProtocol();
            View.SelectedTransferMode    = _host.getTransferType();
            View.SelectedEncoding        = _host.getEncoding() == null ? Default : _host.getEncoding();
            View.EncodingFieldEnabled    = _host.getProtocol().isEncodingConfigurable();
            View.ConnectModeFieldEnabled = _host.getProtocol().getType() == Protocol.Type.ftp;
            View.SelectedConnectMode     = _host.getFTPConnectMode();
            View.PrivateKeyFieldEnabled  = _options.publickey();

            if (_host.getCredentials().isPublicKeyAuthentication())
            {
                String key = _host.getCredentials().getIdentity().getAbsolute();
                if (!_keys.Contains(key))
                {
                    _keys.Add(key);
                    View.PopulatePrivateKeys(_keys);
                }

                View.SelectedPrivateKey = key;
            }
            else
            {
                View.SelectedPrivateKey = LocaleFactory.localizedString("None");
            }

            View.ClientCertificateFieldEnabled = _options.certificate();
            List <string> keys = new List <string> {
                LocaleFactory.localizedString("None")
            };

            if (_options.certificate())
            {
                foreach (String certificate in SystemCertificateStore.ListAliases())
                {
                    keys.Add(certificate);
                }
            }

            View.PopulateClientCertificates(keys);
            if (_host.getCredentials().isCertificateAuthentication())
            {
                View.SelectedClientCertificate = _host.getCredentials().getCertificate();
            }
            else
            {
                View.SelectedClientCertificate = LocaleFactory.localizedString("None");
            }

            View.WebUrlButtonToolTip = new WebUrlProvider(_host).toUrl().getUrl();
            View.WebURL = _host.getWebURL();
            View.Notes  = _host.getComment();
            View.TimezoneFieldEnabled = !_host.getProtocol().isUTCTimezone();
            if (null == _host.getTimezone())
            {
                if (_host.getProtocol().isUTCTimezone())
                {
                    View.SelectedTimezone = UTC.getID();
                }
                else
                {
                    View.SelectedTimezone =
                        TimeZone.getTimeZone(PreferencesFactory.get().getProperty("ftp.timezone.default")).getID();
                }
            }
            else
            {
                View.SelectedTimezone = _host.getTimezone().getID();
            }
        }
示例#19
0
		/// <summary>
		/// Gets a calendar with the specified time zone and locale.
		/// </summary>
		public static Calendar getInstance(TimeZone zone, Locale aLocale)
		{
			return default(Calendar);
		}