Esempio n. 1
0
        /// <summary>
        /// Answers a new SimpleDateFormat with the same pattern and properties as
        /// this SimpleDateFormat.
        /// </summary>
        ///
        /// <returns>a shallow copy of this SimpleDateFormat</returns>
        /// <seealso cref="T:System.ICloneable"/>
        public override Object Clone()
        {
            SimpleDateFormat clone = (SimpleDateFormat)base.Clone();

            clone.formatData          = (DateFormatSymbols)formatData.Clone();
            clone.defaultCenturyStart = new DateTime(((defaultCenturyStart.Ticks / 10000)) * 10000);
            return(clone);
        }
Esempio n. 2
0
 /// <summary>
 /// Sets the DateFormatSymbols used by this SimpleDateFormat.
 /// </summary>
 ///
 /// <param name="value">the DateFormatSymbols</param>
 public void SetDateFormatSymbols(DateFormatSymbols value_ren)
 {
     IBM.ICU.Text.DateFormatSymbols icuSymbols = new IBM.ICU.Text.DateFormatSymbols();
     CopySymbols(value_ren, icuSymbols);
     icuFormat.SetDateFormatSymbols(icuSymbols);
     formatData = (DateFormatSymbols)value_ren.Clone();
 }
Esempio n. 3
0
 /// <summary>
 /// Constructs a new SimpleDateFormat using the specified non-localized
 /// pattern and DateFormatSymbols and the Calendar for the default Locale.
 /// </summary>
 ///
 /// <param name="template">the pattern</param>
 /// <param name="value">the DateFormatSymbols</param>
 /// <exception cref="NullPointerException">if the pattern is null</exception>
 /// <exception cref="IllegalArgumentException">if the pattern is invalid</exception>
 public SimpleDateFormat(String template, DateFormatSymbols value_ren)
     : this(Locale.GetDefault())
 {
     ValidatePattern(template);
     icuFormat = new IBM.ICU.Text.SimpleDateFormat(template,
                                                   Locale.GetDefault());
     pattern    = template;
     formatData = (DateFormatSymbols)value_ren.Clone();
 }