public EventInfo(RemotePromotion remotePromotion) { this.DescriptionRows = new List <DescriptionRow>(); EventParams parsedCustomParams = remotePromotion.ParsedCustomParams as EventParams; this.Title = remotePromotion.ParsedLoca.PopupHeadline; this.Subtitle = remotePromotion.ParsedLoca.PopupTitle; this.Flavor = remotePromotion.ParsedLoca.PopupDescription; this.DescriptionRows.Clear(); if (!string.IsNullOrEmpty(remotePromotion.ParsedLoca.PopupBody)) { char[] separator = new char[] { ';' }; string[] strArray = remotePromotion.ParsedLoca.PopupBody.Split(separator); for (int i = 0; i < strArray.Length; i++) { string str = strArray[i]; if (str != null) { str = str.Trim(); if (!string.IsNullOrEmpty(str)) { SpriteAtlasEntry entry = (parsedCustomParams.DescriptionIcons.Count <= i) ? null : parsedCustomParams.DescriptionIcons[i]; DescriptionRow item = new DescriptionRow(); item.Icon = entry; item.Text = str; this.DescriptionRows.Add(item); } } } } }
private IEnumerable <DescriptionRow> WriteLine(StopConnection connection) { var descriptionRows = new List <DescriptionRow>(); var departureRow = new DescriptionRow { First = connection.StartDateTime.ToString(HOUR_FILTER), Second = connection.SourceStop.Stop.Name }; var lineRow = new DescriptionRow { First = $"{connection.Line.LineType} {connection.Line.Name}", Second = $"{DescriptionResources.Direction}: {_lineDirectionService.GetDirectionStop(connection.Line).Name}", Third = $"{_timeCalculator.CalculateConnectionTime(connection).ToString()} " + $"{DescriptionResources.Minutes}" }; var arrivalRow = new DescriptionRow { First = connection.EndDateTime.ToString(HOUR_FILTER), Second = connection.DestinationStop.Stop.Name }; descriptionRows.Add(departureRow); descriptionRows.Add(lineRow); descriptionRows.Add(arrivalRow); return(descriptionRows); }
public Dictionary <string, string> GetPropertys() { Dictionary <string, string> map = new Dictionary <string, string>(); map.Add("InputPath", InputPath); map.Add("OutputDataPath", OutputDataPath); map.Add("IsRemEmptyLine", IsRemoveEmptyLine.ToString()); map.Add("ExportFileType", ExportFileType.ToString()); map.Add("IsIgnoreCaseFile", IsIgnoreCaseFile.ToString()); map.Add("IsIgnoreCaseSheet", IsIgnoreCaseSheet.ToString()); map.Add("IsCreateFolder", IsCreateFolder.ToString()); map.Add("ContainerFile", ContainerFile); map.Add("ContainerSheet", ContainerSheet); //> 代码输出选项 map.Add("IsOutputCode", IsOutputCode.ToString()); map.Add("OutputCodePath", OutputCodePath); map.Add("DescriptionRow", DescriptionRow.ToString()); map.Add("PropertyTypeRow", PropertyTypeRow.ToString()); map.Add("PropertyNameRow", PropertyNameRow.ToString()); map.Add("StartExportRow", StartExportRow.ToString()); map.Add("ContainerNamespace", ContainerNamespace); map.Add("OutputCodeFileName", OutputCodeFileName); map.Add("UDBDataSet", IsDefineUDBDatasetProperty.ToString()); return(map); }
private DescriptionRow WriteHeader (Stop sourceStop, Stop destinationStop, int travelTimeInMinutes) { var header = new DescriptionRow { First = $"{DescriptionResources.From} {sourceStop.Name}", Second = $"{DescriptionResources.To} {destinationStop.Name}", Third = $"{travelTimeInMinutes.ToString()} {DescriptionResources.Minutes}", }; return(header); }