本文整理汇总了C#中System.Windows.Forms.Document.Take方法的典型用法代码示例。如果您正苦于以下问题:C# Document.Take方法的具体用法?C# Document.Take怎么用?C# Document.Take使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Document
的用法示例。
在下文中一共展示了Document.Take方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrderDocuments
/// <summary>
/// Order documents for searching
/// </summary>
/// <param Name="documents">The list of documents to search</param>
/// <param Name="startDoc">The index of the document to start searching at</param>
/// <param Name="reverse">Whether the search should be backwards</param>
/// <returns></returns>
protected static Document[] OrderDocuments(Document[] documents, int startDoc, bool reverse)
{
//If the search is backwards, reverse the list
//And update the startDoc pointer to the new location
if (reverse)
{
documents = documents.Reverse().ToArray();
startDoc = documents.Length - startDoc - 1;
}
//Reorder the list such that all documents from before the start document
//are removed and added to the end of the list
return documents.Skip(startDoc).Concat(documents.Take(startDoc + 1)).ToArray();
}