You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

435 lines
18 KiB

  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class EnumerableExtensions
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class EnumerableExtensions
  11. ">
  12. <meta name="generator" content="docfx 2.59.3.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <link rel="stylesheet" href="../styles/fix.css">
  18. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  19. <meta property="docfx:navrel" content="../toc.html">
  20. <meta property="docfx:tocrel" content="toc.html">
  21. <meta property="docfx:rel" content="../">
  22. <meta property="docfx:newtab" content="true">
  23. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  24. <div id="wrapper">
  25. <header>
  26. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  27. <div class="container">
  28. <div class="navbar-header">
  29. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  30. <span class="sr-only">Toggle navigation</span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. <span class="icon-bar"></span>
  34. </button>
  35. <a class="navbar-brand" href="../index.html">
  36. <img id="logo" class="svg" src="../logo.svg" alt="">
  37. </a>
  38. </div>
  39. <div class="collapse navbar-collapse" id="navbar">
  40. <form class="navbar-form navbar-right" role="search" id="search">
  41. <div class="form-group">
  42. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  43. </div>
  44. </form>
  45. </div>
  46. </div>
  47. </nav>
  48. <div class="subnav navbar navbar-default">
  49. <div class="container hide-when-search" id="breadcrumb">
  50. <ul class="breadcrumb">
  51. <li></li>
  52. </ul>
  53. </div>
  54. </div>
  55. </header>
  56. <div class="container body-content">
  57. <div id="search-results">
  58. <div class="search-list">Search Results for <span></span></div>
  59. <div class="sr-items">
  60. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  61. </div>
  62. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  63. </div>
  64. </div>
  65. <div role="main" class="container body-content hide-when-search">
  66. <div class="sidenav hide-when-search">
  67. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  68. <div class="sidetoggle collapse" id="sidetoggle">
  69. <div id="sidetoc"></div>
  70. </div>
  71. </div>
  72. <div class="article row grid-right">
  73. <div class="col-md-10">
  74. <article class="content wrap" id="_content" data-uid="IPA.Utilities.EnumerableExtensions">
  75. <h1 id="IPA_Utilities_EnumerableExtensions" data-uid="IPA.Utilities.EnumerableExtensions" class="text-break">Class EnumerableExtensions
  76. </h1>
  77. <div class="markdown level0 summary"><p>Extensions for <see cref="!:IEnumerable&lt;T>"></see> that don&apos;t currently exist in <code>System.Linq</code>.</p>
  78. </div>
  79. <div class="markdown level0 conceptual"></div>
  80. <div class="inheritance">
  81. <h5>Inheritance</h5>
  82. <div class="level0"><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></div>
  83. <div class="level1"><span class="xref">EnumerableExtensions</span></div>
  84. </div>
  85. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.html">IPA.Utilities</a></h6>
  86. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  87. <h5 id="IPA_Utilities_EnumerableExtensions_syntax">Syntax</h5>
  88. <div class="codewrapper">
  89. <pre><code class="lang-csharp hljs">public static class EnumerableExtensions : object</code></pre>
  90. </div>
  91. <h3 id="methods">Methods
  92. </h3>
  93. <span class="small pull-right mobile-hide">
  94. <span class="divider">|</span>
  95. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__1_IEnumerable___0__.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%601(IEnumerable%7B%60%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  96. </span>
  97. <span class="small pull-right mobile-hide">
  98. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Utilities/EnumerableExtensions.cs/#L176">View Source</a>
  99. </span>
  100. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  101. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__1_IEnumerable___0__" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``1(IEnumerable{``0})">NonNull&lt;T&gt;(IEnumerable&lt;T&gt;)</h4>
  102. <div class="markdown level1 summary"><p>LINQ-style extension method that filters <span class="xref">null</span> elements out of an enumeration.</p>
  103. </div>
  104. <div class="markdown level1 conceptual"></div>
  105. <h5 class="decalaration">Declaration</h5>
  106. <div class="codewrapper">
  107. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T&gt;(this IEnumerable&lt;T&gt; self)
  108. where T : class</code></pre>
  109. </div>
  110. <h5 class="parameters">Parameters</h5>
  111. <table class="table table-bordered table-striped table-condensed">
  112. <thead>
  113. <tr>
  114. <th>Type</th>
  115. <th>Name</th>
  116. <th>Description</th>
  117. </tr>
  118. </thead>
  119. <tbody>
  120. <tr>
  121. <td><span class="xref">IEnumerable</span>&lt;T&gt;</td>
  122. <td><span class="parametername">self</span></td>
  123. <td><p>the enumeration to filter</p>
  124. </td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. <h5 class="returns">Returns</h5>
  129. <table class="table table-bordered table-striped table-condensed">
  130. <thead>
  131. <tr>
  132. <th>Type</th>
  133. <th>Description</th>
  134. </tr>
  135. </thead>
  136. <tbody>
  137. <tr>
  138. <td><span class="xref">IEnumerable</span>&lt;T&gt;</td>
  139. <td><p>a filtered enumerable</p>
  140. </td>
  141. </tr>
  142. </tbody>
  143. </table>
  144. <h5 class="typeParameters">Type Parameters</h5>
  145. <table class="table table-bordered table-striped table-condensed">
  146. <thead>
  147. <tr>
  148. <th>Name</th>
  149. <th>Description</th>
  150. </tr>
  151. </thead>
  152. <tbody>
  153. <tr>
  154. <td><span class="parametername">T</span></td>
  155. <td><p>the type of the enumeration</p>
  156. </td>
  157. </tr>
  158. </tbody>
  159. </table>
  160. <span class="small pull-right mobile-hide">
  161. <span class="divider">|</span>
  162. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__1_IEnumerable_System_Nullable___0___.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%601(IEnumerable%7BSystem.Nullable%7B%60%600%7D%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  163. </span>
  164. <span class="small pull-right mobile-hide">
  165. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Utilities/EnumerableExtensions.cs/#L196">View Source</a>
  166. </span>
  167. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  168. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__1_IEnumerable_System_Nullable___0___" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``1(IEnumerable{System.Nullable{``0}})">NonNull&lt;T&gt;(IEnumerable&lt;Nullable&lt;T&gt;&gt;)</h4>
  169. <div class="markdown level1 summary"><p>LINQ-style extension method that filters <span class="xref">null</span> elements from an enumeration of nullable types.</p>
  170. </div>
  171. <div class="markdown level1 conceptual"></div>
  172. <h5 class="decalaration">Declaration</h5>
  173. <div class="codewrapper">
  174. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T&gt;(this IEnumerable&lt;T?&gt; self)
  175. where T : struct</code></pre>
  176. </div>
  177. <h5 class="parameters">Parameters</h5>
  178. <table class="table table-bordered table-striped table-condensed">
  179. <thead>
  180. <tr>
  181. <th>Type</th>
  182. <th>Name</th>
  183. <th>Description</th>
  184. </tr>
  185. </thead>
  186. <tbody>
  187. <tr>
  188. <td><span class="xref">IEnumerable</span>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.nullable-1">Nullable</a>&lt;T&gt;&gt;</td>
  189. <td><span class="parametername">self</span></td>
  190. <td><p>the enumeration to filter</p>
  191. </td>
  192. </tr>
  193. </tbody>
  194. </table>
  195. <h5 class="returns">Returns</h5>
  196. <table class="table table-bordered table-striped table-condensed">
  197. <thead>
  198. <tr>
  199. <th>Type</th>
  200. <th>Description</th>
  201. </tr>
  202. </thead>
  203. <tbody>
  204. <tr>
  205. <td><span class="xref">IEnumerable</span>&lt;T&gt;</td>
  206. <td><p>a filtered enumerable</p>
  207. </td>
  208. </tr>
  209. </tbody>
  210. </table>
  211. <h5 class="typeParameters">Type Parameters</h5>
  212. <table class="table table-bordered table-striped table-condensed">
  213. <thead>
  214. <tr>
  215. <th>Name</th>
  216. <th>Description</th>
  217. </tr>
  218. </thead>
  219. <tbody>
  220. <tr>
  221. <td><span class="parametername">T</span></td>
  222. <td><p>the underlying type of the nullable enumeration</p>
  223. </td>
  224. </tr>
  225. </tbody>
  226. </table>
  227. <span class="small pull-right mobile-hide">
  228. <span class="divider">|</span>
  229. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__2_IEnumerable___0__Func___0___1__.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%602(IEnumerable%7B%60%600%7D%2CFunc%7B%60%600%2C%60%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  230. </span>
  231. <span class="small pull-right mobile-hide">
  232. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Utilities/EnumerableExtensions.cs/#L187">View Source</a>
  233. </span>
  234. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  235. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__2_IEnumerable___0__Func___0___1__" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``2(IEnumerable{``0},Func{``0,``1})">NonNull&lt;T, U&gt;(IEnumerable&lt;T&gt;, Func&lt;T, U&gt;)</h4>
  236. <div class="markdown level1 summary"><p>LINQ-style extension method that filters <span class="xref">null</span> elements out of an enumeration based on a converter.</p>
  237. </div>
  238. <div class="markdown level1 conceptual"></div>
  239. <h5 class="decalaration">Declaration</h5>
  240. <div class="codewrapper">
  241. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T, U&gt;(this IEnumerable&lt;T&gt; self, Func&lt;T, U&gt; pred)
  242. where U : class</code></pre>
  243. </div>
  244. <h5 class="parameters">Parameters</h5>
  245. <table class="table table-bordered table-striped table-condensed">
  246. <thead>
  247. <tr>
  248. <th>Type</th>
  249. <th>Name</th>
  250. <th>Description</th>
  251. </tr>
  252. </thead>
  253. <tbody>
  254. <tr>
  255. <td><span class="xref">IEnumerable</span>&lt;T&gt;</td>
  256. <td><span class="parametername">self</span></td>
  257. <td><p>the enumeration to filter</p>
  258. </td>
  259. </tr>
  260. <tr>
  261. <td><span class="xref">Func</span>&lt;T, U&gt;</td>
  262. <td><span class="parametername">pred</span></td>
  263. <td><p>the predicate to select for filtering</p>
  264. </td>
  265. </tr>
  266. </tbody>
  267. </table>
  268. <h5 class="returns">Returns</h5>
  269. <table class="table table-bordered table-striped table-condensed">
  270. <thead>
  271. <tr>
  272. <th>Type</th>
  273. <th>Description</th>
  274. </tr>
  275. </thead>
  276. <tbody>
  277. <tr>
  278. <td><span class="xref">IEnumerable</span>&lt;T&gt;</td>
  279. <td><p>a filtered enumerable</p>
  280. </td>
  281. </tr>
  282. </tbody>
  283. </table>
  284. <h5 class="typeParameters">Type Parameters</h5>
  285. <table class="table table-bordered table-striped table-condensed">
  286. <thead>
  287. <tr>
  288. <th>Name</th>
  289. <th>Description</th>
  290. </tr>
  291. </thead>
  292. <tbody>
  293. <tr>
  294. <td><span class="parametername">T</span></td>
  295. <td><p>the type of the enumeration</p>
  296. </td>
  297. </tr>
  298. <tr>
  299. <td><span class="parametername">U</span></td>
  300. <td><p>the type to compare to null</p>
  301. </td>
  302. </tr>
  303. </tbody>
  304. </table>
  305. <span class="small pull-right mobile-hide">
  306. <span class="divider">|</span>
  307. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__2_IEnumerable___0__Func___0_System_Nullable___1___.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%602(IEnumerable%7B%60%600%7D%2CFunc%7B%60%600%2CSystem.Nullable%7B%60%601%7D%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  308. </span>
  309. <span class="small pull-right mobile-hide">
  310. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Utilities/EnumerableExtensions.cs/#L207">View Source</a>
  311. </span>
  312. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  313. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__2_IEnumerable___0__Func___0_System_Nullable___1___" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``2(IEnumerable{``0},Func{``0,System.Nullable{``1}})">NonNull&lt;T, U&gt;(IEnumerable&lt;T&gt;, Func&lt;T, Nullable&lt;U&gt;&gt;)</h4>
  314. <div class="markdown level1 summary"><p>LINQ-style extension method that filters <span class="xref">null</span> elements out of an enumeration based on a converter to a nullable type.</p>
  315. </div>
  316. <div class="markdown level1 conceptual"></div>
  317. <h5 class="decalaration">Declaration</h5>
  318. <div class="codewrapper">
  319. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T, U&gt;(this IEnumerable&lt;T&gt; self, Func&lt;T, U?&gt; pred)
  320. where U : struct</code></pre>
  321. </div>
  322. <h5 class="parameters">Parameters</h5>
  323. <table class="table table-bordered table-striped table-condensed">
  324. <thead>
  325. <tr>
  326. <th>Type</th>
  327. <th>Name</th>
  328. <th>Description</th>
  329. </tr>
  330. </thead>
  331. <tbody>
  332. <tr>
  333. <td><span class="xref">IEnumerable</span>&lt;T&gt;</td>
  334. <td><span class="parametername">self</span></td>
  335. <td><p>the enumeration to filter</p>
  336. </td>
  337. </tr>
  338. <tr>
  339. <td><span class="xref">Func</span>&lt;T, <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.nullable-1">Nullable</a>&lt;U&gt;&gt;</td>
  340. <td><span class="parametername">pred</span></td>
  341. <td><p>the predicate to select for filtering</p>
  342. </td>
  343. </tr>
  344. </tbody>
  345. </table>
  346. <h5 class="returns">Returns</h5>
  347. <table class="table table-bordered table-striped table-condensed">
  348. <thead>
  349. <tr>
  350. <th>Type</th>
  351. <th>Description</th>
  352. </tr>
  353. </thead>
  354. <tbody>
  355. <tr>
  356. <td><span class="xref">IEnumerable</span>&lt;T&gt;</td>
  357. <td><p>a filtered enumerable</p>
  358. </td>
  359. </tr>
  360. </tbody>
  361. </table>
  362. <h5 class="typeParameters">Type Parameters</h5>
  363. <table class="table table-bordered table-striped table-condensed">
  364. <thead>
  365. <tr>
  366. <th>Name</th>
  367. <th>Description</th>
  368. </tr>
  369. </thead>
  370. <tbody>
  371. <tr>
  372. <td><span class="parametername">T</span></td>
  373. <td><p>the type of the enumeration</p>
  374. </td>
  375. </tr>
  376. <tr>
  377. <td><span class="parametername">U</span></td>
  378. <td><p>the type of the predicate&apos;s resulting nullable</p>
  379. </td>
  380. </tr>
  381. </tbody>
  382. </table>
  383. </article>
  384. </div>
  385. <div class="hidden-sm col-md-2" role="complementary">
  386. <div class="sideaffix">
  387. <div class="contribution">
  388. <ul class="nav">
  389. <li>
  390. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
  391. </li>
  392. <li>
  393. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Utilities/EnumerableExtensions.cs/#L14" class="contribution-link">View Source</a>
  394. </li>
  395. </ul>
  396. </div>
  397. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  398. <h5>In This Article</h5>
  399. <div></div>
  400. </nav>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. <footer>
  406. <div class="grad-bottom"></div>
  407. <div class="footer">
  408. <div class="container">
  409. <span class="pull-right">
  410. <a href="#top">Back to top</a>
  411. </span>
  412. <span>Generated by <strong>DocFX</strong></span>
  413. </div>
  414. </div>
  415. </footer>
  416. </div>
  417. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  418. <script type="text/javascript" src="../styles/docfx.js"></script>
  419. <script type="text/javascript" src="../styles/main.js"></script>
  420. </body>
  421. </html>