private int GetDateComponentValueFromLogicalIndexBasedOnStepBehavior(StepBehavior behavior, int logicalIndex) { switch (this.componentType) { case DateTimeComponentType.Day: case DateTimeComponentType.Month: case DateTimeComponentType.Year: switch (behavior) { case StepBehavior.Multiples: return((logicalIndex + 1) * this.Step); case StepBehavior.BaseAndMultiples: return(logicalIndex == 0 || this.Step == 1 ? logicalIndex + 1 : logicalIndex *this.Step); case StepBehavior.StartFromBase: return((logicalIndex * this.Step) + 1); default: return(logicalIndex * this.Step); } case DateTimeComponentType.Minute: case DateTimeComponentType.Hour: case DateTimeComponentType.AMPM: return(logicalIndex * this.Step); } return(logicalIndex); }
private void MoveToNextStep(int stepIndex) { if (currentStep.nextSteps.Length > stepIndex) { currentStep = currentStep.nextSteps[stepIndex]; UpdateCurrentLabel(); } }
void Start() { currentStep = startStep; UpdateCurrentLabel(); UpdateCurrentLocation(startStep.locationName); }
internal int GetStepRemainderForComponent(int componentValue, int minComponentValue, StepBehavior behavior, int step) { if (step == 1) { return(0); } var remainder = 0; switch (behavior) { case StepBehavior.Multiples: remainder = componentValue % step; break; case StepBehavior.StartFromBase: remainder = (componentValue - minComponentValue) % step; break; case StepBehavior.BaseAndMultiples: remainder = componentValue == minComponentValue ? 0 : componentValue % step; break; } return(remainder); }