public IWheel SetValueOnWheel(IWheel wheel, string pattern) { var splittet = pattern.Split('/'); wheel.WheelWidth = AWheelOperations.GetIntegerFromString(splittet[0]); wheel.WheelHeight = AWheelOperations.GetIntegerFromString(splittet[1]); return(wheel); }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { var year = pattern.Trim(' ').Replace("DOT", " "); int convertedYear = AWheelOperations.GetIntegerFromString(year); wheel.DotNumber = convertedYear; return(wheel); }
private static IWheel GetWheelWithGivenWheelOperations(string descriptionString, IWheel wheel, IEnumerable <IWheelOperation> wheelOperations) { foreach (IWheelOperation operation in wheelOperations) { var pattern = AWheelOperations.GetPattern(descriptionString, operation.GetRegexPattern()); if (pattern.Equals(string.Empty)) { continue; } wheel = operation.SetValueOnWheel(wheel, pattern); descriptionString = AWheelOperations.CutFromString(descriptionString, pattern); } return(wheel); }
public static IArticle GetWheelForDescription(string descriptionString, string description2String) { IWheel wheel = new Wheel(); var heightWidthPattern = AWheelOperations.GetPattern(descriptionString, heightWidthOperation.GetRegexPattern()); if (heightWidthPattern.Equals(string.Empty)) { return(wheel); } wheel = heightWidthOperation.SetValueOnWheel(wheel, heightWidthPattern); descriptionString = AWheelOperations.CutFromString(descriptionString, heightWidthPattern); wheel = GetWheelWithGivenWheelOperations(descriptionString, wheel, wheelsOperations); wheel = GetWheelWithGivenWheelOperations(description2String, wheel, extraWheelsOperations); return(wheel); }
public IWheel SetValueOnWheel(IWheel wheel, string pattern) { wheel.WeightIndex = AWheelOperations.GetIntegerFromString(pattern); return(wheel); }