本文整理匯總了C#中SirenOfShame.Lib.Settings.SirenOfShameSettings.GetHighWaterMark方法的典型用法代碼示例。如果您正苦於以下問題:C# SirenOfShameSettings.GetHighWaterMark方法的具體用法?C# SirenOfShameSettings.GetHighWaterMark怎麽用?C# SirenOfShameSettings.GetHighWaterMark使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SirenOfShame.Lib.Settings.SirenOfShameSettings
的用法示例。
在下文中一共展示了SirenOfShameSettings.GetHighWaterMark方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExportNewBuilds
public string ExportNewBuilds(SirenOfShameSettings settings)
{
if (string.IsNullOrEmpty(settings.MyRawName)) return null;
DateTime? highWaterMark = settings.GetHighWaterMark();
var initialExport = highWaterMark == null;
var allBuildDefinitions = ReadAll(settings.GetAllActiveBuildDefinitions());
var currentUsersBuilds = allBuildDefinitions
.Where(i => i.RequestedBy == settings.MyRawName)
.Where(i => i.StartedTime != null);
var buildsAfterHighWaterMark = initialExport ? currentUsersBuilds : currentUsersBuilds.Where(i => i.StartedTime > highWaterMark);
var buildsAsExport = buildsAfterHighWaterMark.Select(i => i.AsSosOnlineExport());
var result = string.Join("\r\n", buildsAsExport);
return string.IsNullOrEmpty(result) ? null : result;
}