コード例 #1
0
 /// <summary>
 /// Append the appropriate prefix to the string builder, depending on whether
 /// and how a limit and direction are to be displayed.
 /// </summary>
 ///
 /// <param name="tl">how and whether to display the time limit</param>
 /// <param name="td">how and whether to display the time direction</param>
 /// <param name="sb">the string builder to which to append the text</param>
 /// <returns>true if a following digit will require a digit prefix</returns>
 public bool AppendPrefix(int tl, int td, StringBuilder sb)
 {
     if (dr.scopeData != null)
     {
         int ix = tl * 3 + td;
         IBM.ICU.Impl.Duration.Impl.DataRecord.ScopeData sd = dr.scopeData[ix];
         if (sd != null)
         {
             String prefix = sd.prefix;
             if (prefix != null)
             {
                 sb.Append(prefix);
                 return(sd.requiresDigitPrefix);
             }
         }
     }
     return(false);
 }
コード例 #2
0
 /// <summary>
 /// Append the appropriate suffix to the string builder, depending on whether
 /// and how a limit and direction are to be displayed.
 /// </summary>
 ///
 /// <param name="tl">how and whether to display the time limit</param>
 /// <param name="td">how and whether to display the time direction</param>
 /// <param name="sb">the string builder to which to append the text</param>
 public void AppendSuffix(int tl, int td, StringBuilder sb)
 {
     if (dr.scopeData != null)
     {
         int ix = tl * 3 + td;
         IBM.ICU.Impl.Duration.Impl.DataRecord.ScopeData sd = dr.scopeData[ix];
         if (sd != null)
         {
             String suffix = sd.suffix;
             if (suffix != null)
             {
                 if (trace)
                 {
                     System.Console.Out.WriteLine("appendSuffix '" + suffix + "'");
                 }
                 sb.Append(suffix);
             }
         }
     }
 }