当前位置: 首页>>代码示例>>C#>>正文


C# Document.Skip方法代码示例

本文整理汇总了C#中System.Windows.Forms.Document.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# Document.Skip方法的具体用法?C# Document.Skip怎么用?C# Document.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Document的用法示例。


在下文中一共展示了Document.Skip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SearchDocuments

        /// <summary>
        /// Recursively search all documents for a phrase
        /// </summary>
        /// <param Name="documents">The list of documents to search</param>
        /// <param Name="location">The location to start searching in</param>
        /// <param Name="phrase">The phrase to search for</param>
        /// <param Name="reverse">Whether the search should be backwards</param>
        /// <returns>The location of the phrase, or null if not found</returns>
        protected static Location SearchDocuments(Document[] documents, Location location, string phrase, bool reverse)
        {
            //Search for the phrase, and return if found
            Location output = SearchDocument(location, phrase, reverse);
            if (output != null) { return output; }

            //Remove the first document fro the array, and exit if no documents remain
            Document[] newDocuments = documents.Skip(1).ToArray();
            if (newDocuments.Length == 0) { return null; }

            //Begin the next recursion
            Location newLocation = new Location(location.Window, newDocuments[0], null, null);
            return SearchDocuments(newDocuments, newLocation, phrase, reverse);
        }
开发者ID:malacandrian,项目名称:fyp,代码行数:22,代码来源:FindInterface.cs

示例2: 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();
        }
开发者ID:malacandrian,项目名称:fyp,代码行数:21,代码来源:FindInterface.cs


注:本文中的System.Windows.Forms.Document.Skip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。