本文整理汇总了C#中Entities.List.FindIndex方法的典型用法代码示例。如果您正苦于以下问题:C# List.FindIndex方法的具体用法?C# List.FindIndex怎么用?C# List.FindIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities.List
的用法示例。
在下文中一共展示了List.FindIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public List<Entities.RevisionRange> Execute(Entities.Branch branch, string search, StringBuilder logMessages, List<Entities.RevisionRange> eligible)
{
if (logMessages == null)
{
logMessages = new StringBuilder();
}
List<Entities.RevisionRange> ranges = new List<RevisionRange>();
Dictionary<string, string> settings = settingsBLL.Get();
string userName = SettingsHelper.ValidateUsername(settings);
string password = SettingsHelper.ValidatePassword(settings);
System.Collections.ObjectModel.Collection<SharpSvn.SvnLogEventArgs> logEntries =
new System.Collections.ObjectModel.Collection<SharpSvn.SvnLogEventArgs>();
using (SharpSvn.SvnClient client = BusinessLogic.VersionControl.Svn.ClientHelper.Default())
{
client.Authentication.DefaultCredentials = new System.Net.NetworkCredential(userName, password);
SharpSvn.SvnLogArgs args = new SharpSvn.SvnLogArgs();
client.GetLog(new Uri(branch.Url), out logEntries);
}
foreach (var logEntry in logEntries)
{
if(logEntry.LogMessage.ToLower().Contains(search.ToLower() + " "))
{
var range = new RevisionRange
{
StartRevision = (logEntry.Revision - 1).ToString(),
EndRevision = logEntry.Revision.ToString()
};
if(eligible.FindIndex(x => x.StartRevision == range.StartRevision && x.EndRevision == range.EndRevision) > -1)
{
logMessages.AppendLine(logEntry.LogMessage);
logMessages.AppendLine("................................");
ranges.Add(range);
}
}
}
return ranges;
}