Exemplo n.º 1
0
        protected override void Process(SmallTimeRenderer st)
        {
            string minWords = st.RenderTime.Minute.ToWords();
            string hrWords  = st.RenderTime.Hour.ToWords();

            st.DefaultRenderText(RenderElements.HourText, hrWords);
            st.DefaultRenderText(RenderElements.Intermediary, " ");
            st.DefaultRenderText(RenderElements.MinuteText, minWords);
        }
Exemplo n.º 2
0
 public virtual SmallTimeRenderer Handle(SmallTimeRenderer payload)
 {
     b.Verbose.Log($"{ConverterName} Processing.");
     Process(payload);
     if (next != null)
     {
         return(next.Handle(payload));
     }
     return(payload);
 }
Exemplo n.º 3
0
 protected override void Process(SmallTimeRenderer st)
 {
     if ((st.RenderTime.Hour == SPECIAL_ZERO_MIDNIGHT) || (st.RenderTime.Hour == SPECIAL_TWENTYFOUR_MIDNIGHT))
     {
         st.ForceRenderText(RenderElements.HourText, "midnight");
     }
     if (st.RenderTime.Hour == SPECIAL_12_NOON)
     {
         st.ForceRenderText(RenderElements.HourText, "noon");
     }
 }
Exemplo n.º 4
0
 protected override void Process(SmallTimeRenderer st)
 {
     if (st.RenderTime.Minute <= HALF_PAST_MINS)
     {
         st.DefaultRenderText(RenderElements.Intermediary, " past ");
     }
     else
     {
         st.DefaultRenderText(RenderElements.Intermediary, " to ");
         st.RenderTime.Hour  += 1;
         st.RenderTime.Minute = MINUTESINHOUR - st.Time.Minute;
     }
 }
Exemplo n.º 5
0
 protected override void Process(SmallTimeRenderer st)
 {
     if ((st.RenderTime.Minute == QUARTER_PAST_MINS) || (st.RenderTime.Minute == QUARTER_TO_MINS))
     {
         st.ForceRenderText(RenderElements.MinuteText, "quarter");
     }
     if (st.RenderTime.Minute == HALF_PAST_MINS)
     {
         st.ForceRenderText(RenderElements.MinuteText, "half");
     }
     if (st.RenderTime.Minute == 0)
     {
         st.ForceRenderText(RenderElements.Intermediary, " exactly ");
         st.FormatString = "%HUR%%INT%";  // Remove the minute capability
     }
 }
Exemplo n.º 6
0
 public string ConvertTime(SmallTimeRenderer st)
 {
     b.Info.Flow();
     return(converter.Convert(st));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Take the time, run it through the chain and return the rendered result.
 /// </summary>
 /// <param name="time">Time to render</param>
 /// <returns>Rendered string</returns>
 public string Convert(SmallTimeRenderer time)
 {
     return(Handle(time).Render());
 }
Exemplo n.º 8
0
 protected abstract void Process(SmallTimeRenderer st);