本文整理匯總了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();
}