本文整理汇总了C#中iTextSharp.text.List.Delimited方法的典型用法代码示例。如果您正苦于以下问题:C# List.Delimited方法的具体用法?C# List.Delimited怎么用?C# List.Delimited使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.List
的用法示例。
在下文中一共展示了List.Delimited方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Generate
public static void Generate(IEnumerable<ICrew> ecrews)
{
ILog logger = LogManager.GetCurrentClassLogger ();
IList<ICrew> crews = ecrews.ToList();
int showAthlete = Int32.Parse(ConfigurationManager.AppSettings ["showcompetitor"].ToString ());
if(crews.Any(cr => cr.StartNumber > 0))
{
logger.Info ("crews have start numbers. ");
if(crews.Any(cr => cr.StartNumber <= 0))
logger.Warn ("but some don't, that's not right - delete the start positions or fix the JSON.");
Dump (crews, showAthlete);
return;
}
IList<string> startpositions = new List<string> ();
int lym = Int32.Parse (ConfigurationManager.AppSettings ["LastYearMen"].ToString ());
int lyw = Int32.Parse(ConfigurationManager.AppSettings["LastYearWomen"].ToString());
int lywo = Int32.Parse(ConfigurationManager.AppSettings["LastYearWomenOrder"].ToString());
foreach(var crew in
crews
.Where(cr => !cr.IsScratched) // && cr.IsAccepted)
.OrderBy(cr => cr.EventCategory.Gender == Gender.Open && cr.PreviousYear.HasValue && cr.PreviousYear.Value <= lym ? cr.PreviousYear.Value : lym+1)
// if the cat order is before last year's women, observe it, otherwise part it - so that last year's women aren't directly behind last year's men.
.ThenBy(cr => cr.Categories.First(cat => cat is EventCategory).Order < lywo ? cr.Categories.First(cat => cat is EventCategory).Order : lywo)
.ThenBy(cr => cr.EventCategory.Gender == Gender.Female && cr.PreviousYear.HasValue && cr.PreviousYear.Value <= lyw ? cr.PreviousYear.Value : lyw+1)
.ThenBy(cr => cr.Categories.First(cat => cat is EventCategory).Order)
.ThenBy(cr => cr.CrewId.Reverse()))
// todo - put the vets head vs scullers head into config
// foreach(var crew in
// crews
// .OrderBy(cr => cr.Categories.First(cat => cat is EventCategory).Order)
// .ThenBy(cr => cr.PreviousYear.HasValue && cr.PreviousYear.Value <= 3 ? cr.PreviousYear.Value : 5)
// .ThenBy(cr => cr.CrewId.Reverse()))
{
logger.InfoFormat("{0} [{2}], {1}, {3}, {4}",
crew.Name, crew.CategoryName,
crew.AthleteName(showAthlete, true), crew.CrewId,
crew.PreviousYear.HasValue ? crew.PreviousYear : -1);
startpositions.Add(String.Format("{{\"CrewId\":{0},\"StartNumber\":{1}}}", crew.CrewId, startpositions.Count+1));
}
logger.Info(startpositions.Delimited());
}