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); }
public virtual SmallTimeRenderer Handle(SmallTimeRenderer payload) { b.Verbose.Log($"{ConverterName} Processing."); Process(payload); if (next != null) { return(next.Handle(payload)); } return(payload); }
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"); } }
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; } }
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 } }
public string ConvertTime(SmallTimeRenderer st) { b.Info.Flow(); return(converter.Convert(st)); }
/// <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()); }
protected abstract void Process(SmallTimeRenderer st);