public string GetDiscription(int?precision = null, ITimeFormatter formatter = null) { precision = precision ?? int.MaxValue; formatter = formatter ?? TimeFormatter.Instance; precision.Value.ShouldBePositive("precision"); var elapsedTimes = new[] { ElapsedYears, ElapsedMonths, ElapsedDays, ElapsedHours, ElapsedMinutes, ElapsedSeconds }; if (precision <= elapsedTimes.Length - 1) { for (var i = precision.Value; i < elapsedTimes.Length; i++) { elapsedTimes[i] = 0; } } return(formatter.GetDuration(elapsedTimes[0], elapsedTimes[1], elapsedTimes[2], elapsedTimes[3], elapsedTimes[4], elapsedTimes[5])); }
} // ElapsedSeconds // ---------------------------------------------------------------------- public string GetDescription(int precision = int.MaxValue, ITimeFormatter formatter = null) { if (precision < 1) { throw new ArgumentOutOfRangeException("precision"); } formatter = formatter ?? TimeFormatter.Instance; int[] elapsedItems = new int[6]; elapsedItems[0] = ElapsedYears; elapsedItems[1] = ElapsedMonths; elapsedItems[2] = ElapsedDays; elapsedItems[3] = ElapsedHours; elapsedItems[4] = ElapsedMinutes; elapsedItems[5] = ElapsedSeconds; if (precision <= elapsedItems.Length - 1) { for (int i = precision; i < elapsedItems.Length; i++) { elapsedItems[i] = 0; } } return(formatter.GetDuration( elapsedItems[0], elapsedItems[1], elapsedItems[2], elapsedItems[3], elapsedItems[4], elapsedItems[5])); } // GetDescription
protected override string Format(ITimeFormatter formatter) { return formatter.GetCalendarPeriod(StartYearName, EndYearName, formatter.GetShortDate(Start), formatter.GetShortDate(End), Duration); }
public CommonMealShoppingInfoMapper(ITimeFormatter timeFormatter, ICommonMealExpenseMapper commonMealExpenseMapper, ICommonMealRepository commonMealRepository, IPersonGroupMapper personGroupMapper) { _timeFormatter = timeFormatter; _commonMealExpenseMapper = commonMealExpenseMapper; _commonMealRepository = commonMealRepository; _personGroupMapper = personGroupMapper; }
protected override string Format(ITimeFormatter formatter) { var fmt = formatter ?? TimeFormatter.Instance; return fmt.GetCalendarPeriod(QuarterOfYearName, fmt.GetShortDate(Start), fmt.GetShortDate(End), Duration); }
public CommonMealMapper(ITimeFormatter timeFormatter, ICommonMealRegistrationGroupFactory registrationGroupFactory, ICommonMealRegistrationMapper commonMealRegistrationMapper, ICommonMealChefMapper commonMealChefMapper, ITimeProvider timeProvider) { _timeFormatter = timeFormatter; _registrationGroupFactory = registrationGroupFactory; _commonMealRegistrationMapper = commonMealRegistrationMapper; _commonMealChefMapper = commonMealChefMapper; _timeProvider = timeProvider; }
protected override string Format(ITimeFormatter formatter) { return(formatter.GetCalendarPeriod(StartYearName, EndYearName, formatter.GetShortDate(Start), formatter.GetShortDate(End), Duration)); }
protected override string Format(ITimeFormatter formatter) { var fmt = formatter ?? TimeFormatter.Instance; return(fmt.GetCalendarPeriod(QuarterOfYearName, fmt.GetShortDate(Start), fmt.GetShortDate(End), Duration)); }
public Crysis3Component(LiveSplitState state) { this.Settings = new Crysis3.Crysis3Settings(); SplitTimeFormatter = new RegularTimeFormatter(TimeAccuracy.Hundredths); Model = new TimerModel(); State = state; Model.CurrentState = State; Start(); }
public ActionEditor(SplitAction action) { TimeFormatter = new ShortTimeFormatter(); ReturnedAction = (SplitAction)action.Clone(); DialogResult = DialogResult.Cancel; InitializeComponent(); //Bindings for whatever reason cause "right to left"... RB_Prediction_Name.Text = ReturnedAction.Header; RB_Option1.Text = ReturnedAction.Answer1; RB_Option2.Text = ReturnedAction.Answer2; PredictionLenght = TimeSpan.FromSeconds(ReturnedAction.Lenght); L_PreditionLenghtLimit.Text = $"{RB_Prediction_Name.TextLength}/{RB_Prediction_Name.MaxLength}"; L_CharactersUsedOutcome1.Text = $"{RB_Option1.TextLength}/{RB_Option1.MaxLength}"; L_CharactersUsedOutcome2.Text = $"{RB_Option2.TextLength}/{RB_Option2.MaxLength}"; TB_PredictionLenght.DataBindings.Add("Text", this, "PredictionLenghtGetSetter"); }
public MessageService(IMessageRepository messageRepository, ITimeFormatter timeFormatter, IFollowRepository followRepository) { _messageRepository = messageRepository; _timeFormatter = timeFormatter; _followRepository = followRepository; }
/// <summary> /// TimePeriod의 설명을 표현합니다. /// </summary> /// <returns></returns> public virtual string GetDescription(ITimeFormatter formatter) { return(Format(formatter ?? TimeFormatter.Instance)); }
protected override string Format(ITimeFormatter formatter) { return(formatter.GetCalendarPeriod(Year.ToString(CultureInfo.InvariantCulture), formatter.GetShortDate(Start), formatter.GetShortDate(End), Duration)); }
public TimeService(ITimeProvider timeProvider, ITimeFormatter timeFormatter) { TimeProvider = timeProvider; TimeFormatter = timeFormatter; }
} // Reset // ---------------------------------------------------------------------- public string GetDescription(ITimeFormatter formatter = null) { return(Format(formatter ?? TimeFormatter.Instance)); } // GetDescription
} // Copy // ---------------------------------------------------------------------- protected override string Format(ITimeFormatter formatter) { return(formatter.GetCalendarPeriod(formatter.GetDateTime(Start), formatter.GetDateTime(End), Duration)); } // Format
/// <summary> /// <paramref name="formatter"/>로 포맷한 문자열을 반환합니다. /// </summary> /// <param name="formatter"></param> /// <returns></returns> public virtual string Format(ITimeFormatter formatter = null) { return (formatter ?? TimeFormatter.Instance).GetCollectionPeriod(Count, Start, End, Duration); }
public BerlinClockTimeConverter(ITimeFormatter timeFormatter, ITimeParser timeParser) { this.timeFormatter = timeFormatter; this.timeParser = timeParser; }
// ---------------------------------------------------------------------- protected override string Format( ITimeFormatter formatter ) { return formatter.GetCalendarPeriod( formatter.GetDateTime( Start), formatter.GetDateTime( End ), Duration ); }
// ---------------------------------------------------------------------- protected virtual string Format( ITimeFormatter formatter ) { return formatter.GetInterval( startInterval, endInterval, startEdge, endEdge, Duration ); }
public Settings() { //Init setting to default values InitializeComponent(); CanUnBet = true; UnBetPenalty = 50; MinimumTime = new TimeSpan(0, 0, 1); NbScores = 5; UseGlobalTime = false; Method = "Current Timing Method"; AllowMods = false; SingleLineScores = false; TimeToShow = "Best Segments"; Delay = 0; ParentSubSplits = false; SelectedSegments = new List <string>(); //Init messages to default values msgEnable = "SplitsBet enabled!"; msgDisable = "SplitsBet disabled!"; msgReset = "Run is kill. RIP :("; msgTimerNotRunning = "Timer is not running; bets are closed;"; msgTimerPaused = "Timer is paused; bets are paused too."; msgTimerEnded = "Run is over; there is nothing to bet on!"; msgNoScore = "Timer is not running; no score available."; msgNoHighscore = "No highscore yet!"; msgNoUnbet = "You can't unbet :("; msgUnbetTimerEnd = "The run has ended, you can't unbet!"; msgCheckTimerEnd = "The run has ended; nothing to check!"; msgTooLateToBet = "Too late to bet for this split; wait for the next one!"; Formatter = new RegularTimeFormatter(); //DataBindings for Settings chkCancelBets.DataBindings.Add("Checked", this, "CanUnBet", false, DataSourceUpdateMode.OnPropertyChanged); txtCancelingPenalty.DataBindings.Add("Text", this, "UnBetPenalty", false, DataSourceUpdateMode.OnPropertyChanged); numScores.DataBindings.Add("Value", this, "NbScores", false, DataSourceUpdateMode.OnPropertyChanged); chkGlobalTime.DataBindings.Add("Checked", this, "UseGlobalTime", false, DataSourceUpdateMode.OnPropertyChanged); cmbTimingMethod.DataBindings.Add("SelectedItem", this, "OverridenTimingMethod", false, DataSourceUpdateMode.OnPropertyChanged); chkAllowMods.DataBindings.Add("Checked", this, "AllowMods", false, DataSourceUpdateMode.OnPropertyChanged); chkSingleLineScores.DataBindings.Add("Checked", this, "SingleLineScores", false, DataSourceUpdateMode.OnPropertyChanged); cmbTimeToShow.DataBindings.Add("SelectedItem", this, "TimeToShow", false, DataSourceUpdateMode.OnPropertyChanged); txtDelay.DataBindings.Add("Text", this, "Delay", false, DataSourceUpdateMode.OnPropertyChanged); chkSubsplits.DataBindings.Add("Checked", this, "ParentSubSplits", false, DataSourceUpdateMode.OnPropertyChanged); //DataBindings for Bot Messages txtMsgEnable.DataBindings.Add("Text", this, "msgEnable", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgDisable.DataBindings.Add("Text", this, "msgDisable", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgReset.DataBindings.Add("Text", this, "msgReset", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgTimerNotRunning.DataBindings.Add("Text", this, "msgTimerNotRunning", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgTimerPaused.DataBindings.Add("Text", this, "msgTimerPaused", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgTimerEnded.DataBindings.Add("Text", this, "msgTimerEnded", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgNoScore.DataBindings.Add("Text", this, "msgNoScore", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgNoHighscore.DataBindings.Add("Text", this, "msgNoHighscore", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgNoUnbet.DataBindings.Add("Text", this, "msgNoUnbet", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgUnbetTimerEnd.DataBindings.Add("Text", this, "msgUnbetTimerEnd", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgCheckTimerEnd.DataBindings.Add("Text", this, "msgCheckTimerEnd", false, DataSourceUpdateMode.OnPropertyChanged); txtMsgTooLateToBet.DataBindings.Add("Text", this, "msgTooLateToBet", false, DataSourceUpdateMode.OnPropertyChanged); this.Load += Settings_Load; }
// ---------------------------------------------------------------------- protected virtual string Format( ITimeFormatter formatter ) { return formatter.GetCollectionPeriod( Count, Start, End, Duration ); }
public string Format(ITimeFormatter formatter) { return Second.HasValue ? formatter.GetTimeString(Hour, Minute, Second.Value) : formatter.GetTimeString(Hour, Minute); }
public InfoTimeComponent(String informationName, TimeSpan?timeValue, ITimeFormatter formatter) : base(informationName, "") { Formatter = formatter; TimeValue = timeValue; }
public void Setup() { formatter = Substitute.For <ITimeFormatter>(); parser = Substitute.For <ITimeParser>(); }
public string GetFormattedTime(ITimeFormatter formatter) { var duration = GetTime(); return formatter.Format(duration); }
} // GetDescription // ---------------------------------------------------------------------- protected virtual string Format(ITimeFormatter formatter) { return(formatter.GetCollectionPeriod(Count, Start, End, Duration)); } // Format
/// <summary> /// TimePeriod의 설명을 표현합니다. /// </summary> /// <returns></returns> public virtual string GetDescription(ITimeFormatter formatter) { return Format(formatter ?? TimeFormatter.Instance); }
/// <summary> /// TimePeriod의 설명을 문자열로 반환합니다. /// </summary> /// <returns></returns> public string GetDescription(ITimeFormatter formatter = null) { return Format(formatter); }
// ---------------------------------------------------------------------- protected override string Format( ITimeFormatter formatter ) { return string.Format( "{0}{1}", base.Format( formatter ), Direction == PlayDirection.Forward ? ">" : "<" ); }
} // IsSamePeriod // ---------------------------------------------------------------------- protected override string Format(ITimeFormatter formatter) { return(string.Format("{0}{1}", base.Format(formatter), Direction == PlayDirection.Forward ? ">" : "<")); } // Format
//--------------------------------------------------------------------- protected override string Format(ITimeFormatter formatter) { return formatter.GetInterval(_start, _end, _startEdge, _endEdge, Duration); }
public void TestSetup() { this.formatter = new SmartTimeFormatter(); }
/// <summary> /// TimePeriod의 설명을 문자열로 반환합니다. /// </summary> /// <returns></returns> public string GetDescription(ITimeFormatter formatter = null) { return(Format(formatter)); }
/// <summary> /// <paramref name="formatter"/>를 이용하여 기간 내용을 문자열로 표현합니다. /// </summary> /// <param name="formatter"></param> /// <returns></returns> protected virtual string Format(ITimeFormatter formatter) { return formatter.GetPeriod(Start, End, Duration); }
/// <summary> /// <paramref name="formatter"/>로 포맷한 문자열을 반환합니다. /// </summary> /// <param name="formatter"></param> /// <returns></returns> public virtual string Format(ITimeFormatter formatter = null) { return((formatter ?? TimeFormatter.Instance).GetCollectionPeriod(Count, Start, End, Duration)); }
public InfoTimeComponent(string informationName, TimeSpan? timeValue, ITimeFormatter formatter) : base(informationName, "") { Formatter = formatter; TimeValue = timeValue; }
// ---------------------------------------------------------------------- public string GetDescription( ITimeFormatter formatter = null ) { return Format( formatter ?? TimeFormatter.Instance ); }
} // GetDescription // ---------------------------------------------------------------------- protected virtual string Format(ITimeFormatter formatter) { return(formatter.GetPeriod(start, end, Duration)); } // Format
// ---------------------------------------------------------------------- public string GetDescription( int precision = int.MaxValue, ITimeFormatter formatter = null ) { if ( precision < 1 ) { throw new ArgumentOutOfRangeException( "precision" ); } formatter = formatter ?? TimeFormatter.Instance; int[] elapsedItems = new int[ 6 ]; elapsedItems[ 0 ] = ElapsedYears; elapsedItems[ 1 ] = ElapsedMonths; elapsedItems[ 2 ] = ElapsedDays; elapsedItems[ 3 ] = ElapsedHours; elapsedItems[ 4 ] = ElapsedMinutes; elapsedItems[ 5 ] = ElapsedSeconds; if ( precision <= elapsedItems.Length - 1 ) { for ( int i = precision; i < elapsedItems.Length; i++ ) { elapsedItems[ i ] = 0; } } return formatter.GetDuration( elapsedItems[ 0 ], elapsedItems[ 1 ], elapsedItems[ 2 ], elapsedItems[ 3 ], elapsedItems[ 4 ], elapsedItems[ 5 ] ); }
} // AddMonths // ---------------------------------------------------------------------- protected override string Format(ITimeFormatter formatter) { return(formatter.GetCalendarPeriod(string.Format("{0}/{1}", Year, Month), formatter.GetShortDate(Start), formatter.GetShortDate(End), Duration)); } // Format
public BerlinClockFormat(ITimeFormatter timeFormatter) { this.timeFormatter = timeFormatter; }
} // GetDescription // ---------------------------------------------------------------------- protected virtual string Format(ITimeFormatter formatter) { return(formatter.GetInterval(startInterval, endInterval, startEdge, endEdge, Duration)); } // Format
//--------------------------------------------------------------------- protected override string Format(ITimeFormatter formatter) { return(formatter.GetInterval(_start, _end, _startEdge, _endEdge, Duration)); }