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.

459 lines
20 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  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.4.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 <span class="xref">System.Collections.Generic.IEnumerable&lt;T&gt;</span> 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"><span class="xref">System.Object</span></div>
  83. <div class="level1"><span class="xref">EnumerableExtensions</span></div>
  84. </div>
  85. <div class="inheritedMembers">
  86. <h5>Inherited Members</h5>
  87. <div>
  88. <span class="xref">System.Object.ToString()</span>
  89. </div>
  90. <div>
  91. <span class="xref">System.Object.Equals(System.Object)</span>
  92. </div>
  93. <div>
  94. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  95. </div>
  96. <div>
  97. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  98. </div>
  99. <div>
  100. <span class="xref">System.Object.GetHashCode()</span>
  101. </div>
  102. <div>
  103. <span class="xref">System.Object.GetType()</span>
  104. </div>
  105. <div>
  106. <span class="xref">System.Object.MemberwiseClone()</span>
  107. </div>
  108. </div>
  109. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.html">IPA.Utilities</a></h6>
  110. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  111. <h5 id="IPA_Utilities_EnumerableExtensions_syntax">Syntax</h5>
  112. <div class="codewrapper">
  113. <pre><code class="lang-csharp hljs">public static class EnumerableExtensions</code></pre>
  114. </div>
  115. <h3 id="methods">Methods
  116. </h3>
  117. <span class="small pull-right mobile-hide">
  118. <span class="divider">|</span>
  119. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__1_System_Collections_Generic_IEnumerable___0__.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%601(System.Collections.Generic.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>
  120. </span>
  121. <span class="small pull-right mobile-hide">
  122. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/35990a78282d14ea4464e68ee973182877edc9fa/IPA.Loader/Utilities/EnumerableExtensions.cs/#L176">View Source</a>
  123. </span>
  124. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  125. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__1_System_Collections_Generic_IEnumerable___0__" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``1(System.Collections.Generic.IEnumerable{``0})">NonNull&lt;T&gt;(IEnumerable&lt;T&gt;)</h4>
  126. <div class="markdown level1 summary"><p>LINQ-style extension method that filters <span class="xref">null</span> elements out of an enumeration.</p>
  127. </div>
  128. <div class="markdown level1 conceptual"></div>
  129. <h5 class="decalaration">Declaration</h5>
  130. <div class="codewrapper">
  131. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T&gt;(this IEnumerable&lt;T&gt; self)
  132. where T : class</code></pre>
  133. </div>
  134. <h5 class="parameters">Parameters</h5>
  135. <table class="table table-bordered table-striped table-condensed">
  136. <thead>
  137. <tr>
  138. <th>Type</th>
  139. <th>Name</th>
  140. <th>Description</th>
  141. </tr>
  142. </thead>
  143. <tbody>
  144. <tr>
  145. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</td>
  146. <td><span class="parametername">self</span></td>
  147. <td><p>the enumeration to filter</p>
  148. </td>
  149. </tr>
  150. </tbody>
  151. </table>
  152. <h5 class="returns">Returns</h5>
  153. <table class="table table-bordered table-striped table-condensed">
  154. <thead>
  155. <tr>
  156. <th>Type</th>
  157. <th>Description</th>
  158. </tr>
  159. </thead>
  160. <tbody>
  161. <tr>
  162. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</td>
  163. <td><p>a filtered enumerable</p>
  164. </td>
  165. </tr>
  166. </tbody>
  167. </table>
  168. <h5 class="typeParameters">Type Parameters</h5>
  169. <table class="table table-bordered table-striped table-condensed">
  170. <thead>
  171. <tr>
  172. <th>Name</th>
  173. <th>Description</th>
  174. </tr>
  175. </thead>
  176. <tbody>
  177. <tr>
  178. <td><span class="parametername">T</span></td>
  179. <td><p>the type of the enumeration</p>
  180. </td>
  181. </tr>
  182. </tbody>
  183. </table>
  184. <span class="small pull-right mobile-hide">
  185. <span class="divider">|</span>
  186. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__1_System_Collections_Generic_IEnumerable_System_Nullable___0___.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%601(System.Collections.Generic.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>
  187. </span>
  188. <span class="small pull-right mobile-hide">
  189. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/35990a78282d14ea4464e68ee973182877edc9fa/IPA.Loader/Utilities/EnumerableExtensions.cs/#L196">View Source</a>
  190. </span>
  191. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  192. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__1_System_Collections_Generic_IEnumerable_System_Nullable___0___" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``1(System.Collections.Generic.IEnumerable{System.Nullable{``0}})">NonNull&lt;T&gt;(IEnumerable&lt;Nullable&lt;T&gt;&gt;)</h4>
  193. <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>
  194. </div>
  195. <div class="markdown level1 conceptual"></div>
  196. <h5 class="decalaration">Declaration</h5>
  197. <div class="codewrapper">
  198. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T&gt;(this IEnumerable&lt;T?&gt; self)
  199. where T : struct</code></pre>
  200. </div>
  201. <h5 class="parameters">Parameters</h5>
  202. <table class="table table-bordered table-striped table-condensed">
  203. <thead>
  204. <tr>
  205. <th>Type</th>
  206. <th>Name</th>
  207. <th>Description</th>
  208. </tr>
  209. </thead>
  210. <tbody>
  211. <tr>
  212. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;<span class="xref">System.Nullable</span>&lt;T&gt;&gt;</td>
  213. <td><span class="parametername">self</span></td>
  214. <td><p>the enumeration to filter</p>
  215. </td>
  216. </tr>
  217. </tbody>
  218. </table>
  219. <h5 class="returns">Returns</h5>
  220. <table class="table table-bordered table-striped table-condensed">
  221. <thead>
  222. <tr>
  223. <th>Type</th>
  224. <th>Description</th>
  225. </tr>
  226. </thead>
  227. <tbody>
  228. <tr>
  229. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</td>
  230. <td><p>a filtered enumerable</p>
  231. </td>
  232. </tr>
  233. </tbody>
  234. </table>
  235. <h5 class="typeParameters">Type Parameters</h5>
  236. <table class="table table-bordered table-striped table-condensed">
  237. <thead>
  238. <tr>
  239. <th>Name</th>
  240. <th>Description</th>
  241. </tr>
  242. </thead>
  243. <tbody>
  244. <tr>
  245. <td><span class="parametername">T</span></td>
  246. <td><p>the underlying type of the nullable enumeration</p>
  247. </td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. <span class="small pull-right mobile-hide">
  252. <span class="divider">|</span>
  253. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__2_System_Collections_Generic_IEnumerable___0__System_Func___0___1__.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%602(System.Collections.Generic.IEnumerable%7B%60%600%7D%2CSystem.Func%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>
  254. </span>
  255. <span class="small pull-right mobile-hide">
  256. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/35990a78282d14ea4464e68ee973182877edc9fa/IPA.Loader/Utilities/EnumerableExtensions.cs/#L187">View Source</a>
  257. </span>
  258. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  259. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__2_System_Collections_Generic_IEnumerable___0__System_Func___0___1__" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1})">NonNull&lt;T, U&gt;(IEnumerable&lt;T&gt;, Func&lt;T, U&gt;)</h4>
  260. <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>
  261. </div>
  262. <div class="markdown level1 conceptual"></div>
  263. <h5 class="decalaration">Declaration</h5>
  264. <div class="codewrapper">
  265. <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)
  266. where U : class</code></pre>
  267. </div>
  268. <h5 class="parameters">Parameters</h5>
  269. <table class="table table-bordered table-striped table-condensed">
  270. <thead>
  271. <tr>
  272. <th>Type</th>
  273. <th>Name</th>
  274. <th>Description</th>
  275. </tr>
  276. </thead>
  277. <tbody>
  278. <tr>
  279. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</td>
  280. <td><span class="parametername">self</span></td>
  281. <td><p>the enumeration to filter</p>
  282. </td>
  283. </tr>
  284. <tr>
  285. <td><span class="xref">System.Func</span>&lt;T, U&gt;</td>
  286. <td><span class="parametername">pred</span></td>
  287. <td><p>the predicate to select for filtering</p>
  288. </td>
  289. </tr>
  290. </tbody>
  291. </table>
  292. <h5 class="returns">Returns</h5>
  293. <table class="table table-bordered table-striped table-condensed">
  294. <thead>
  295. <tr>
  296. <th>Type</th>
  297. <th>Description</th>
  298. </tr>
  299. </thead>
  300. <tbody>
  301. <tr>
  302. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</td>
  303. <td><p>a filtered enumerable</p>
  304. </td>
  305. </tr>
  306. </tbody>
  307. </table>
  308. <h5 class="typeParameters">Type Parameters</h5>
  309. <table class="table table-bordered table-striped table-condensed">
  310. <thead>
  311. <tr>
  312. <th>Name</th>
  313. <th>Description</th>
  314. </tr>
  315. </thead>
  316. <tbody>
  317. <tr>
  318. <td><span class="parametername">T</span></td>
  319. <td><p>the type of the enumeration</p>
  320. </td>
  321. </tr>
  322. <tr>
  323. <td><span class="parametername">U</span></td>
  324. <td><p>the type to compare to null</p>
  325. </td>
  326. </tr>
  327. </tbody>
  328. </table>
  329. <span class="small pull-right mobile-hide">
  330. <span class="divider">|</span>
  331. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_NonNull__2_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Nullable___1___.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.NonNull%60%602(System.Collections.Generic.IEnumerable%7B%60%600%7D%2CSystem.Func%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>
  332. </span>
  333. <span class="small pull-right mobile-hide">
  334. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/35990a78282d14ea4464e68ee973182877edc9fa/IPA.Loader/Utilities/EnumerableExtensions.cs/#L207">View Source</a>
  335. </span>
  336. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  337. <h4 id="IPA_Utilities_EnumerableExtensions_NonNull__2_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Nullable___1___" data-uid="IPA.Utilities.EnumerableExtensions.NonNull``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,System.Nullable{``1}})">NonNull&lt;T, U&gt;(IEnumerable&lt;T&gt;, Func&lt;T, Nullable&lt;U&gt;&gt;)</h4>
  338. <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>
  339. </div>
  340. <div class="markdown level1 conceptual"></div>
  341. <h5 class="decalaration">Declaration</h5>
  342. <div class="codewrapper">
  343. <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)
  344. where U : struct</code></pre>
  345. </div>
  346. <h5 class="parameters">Parameters</h5>
  347. <table class="table table-bordered table-striped table-condensed">
  348. <thead>
  349. <tr>
  350. <th>Type</th>
  351. <th>Name</th>
  352. <th>Description</th>
  353. </tr>
  354. </thead>
  355. <tbody>
  356. <tr>
  357. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</td>
  358. <td><span class="parametername">self</span></td>
  359. <td><p>the enumeration to filter</p>
  360. </td>
  361. </tr>
  362. <tr>
  363. <td><span class="xref">System.Func</span>&lt;T, <span class="xref">System.Nullable</span>&lt;U&gt;&gt;</td>
  364. <td><span class="parametername">pred</span></td>
  365. <td><p>the predicate to select for filtering</p>
  366. </td>
  367. </tr>
  368. </tbody>
  369. </table>
  370. <h5 class="returns">Returns</h5>
  371. <table class="table table-bordered table-striped table-condensed">
  372. <thead>
  373. <tr>
  374. <th>Type</th>
  375. <th>Description</th>
  376. </tr>
  377. </thead>
  378. <tbody>
  379. <tr>
  380. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</td>
  381. <td><p>a filtered enumerable</p>
  382. </td>
  383. </tr>
  384. </tbody>
  385. </table>
  386. <h5 class="typeParameters">Type Parameters</h5>
  387. <table class="table table-bordered table-striped table-condensed">
  388. <thead>
  389. <tr>
  390. <th>Name</th>
  391. <th>Description</th>
  392. </tr>
  393. </thead>
  394. <tbody>
  395. <tr>
  396. <td><span class="parametername">T</span></td>
  397. <td><p>the type of the enumeration</p>
  398. </td>
  399. </tr>
  400. <tr>
  401. <td><span class="parametername">U</span></td>
  402. <td><p>the type of the predicate&apos;s resulting nullable</p>
  403. </td>
  404. </tr>
  405. </tbody>
  406. </table>
  407. </article>
  408. </div>
  409. <div class="hidden-sm col-md-2" role="complementary">
  410. <div class="sideaffix">
  411. <div class="contribution">
  412. <ul class="nav">
  413. <li>
  414. <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>
  415. </li>
  416. <li>
  417. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/35990a78282d14ea4464e68ee973182877edc9fa/IPA.Loader/Utilities/EnumerableExtensions.cs/#L14" class="contribution-link">View Source</a>
  418. </li>
  419. </ul>
  420. </div>
  421. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  422. <h5>In This Article</h5>
  423. <div></div>
  424. </nav>
  425. </div>
  426. </div>
  427. </div>
  428. </div>
  429. <footer>
  430. <div class="grad-bottom"></div>
  431. <div class="footer">
  432. <div class="container">
  433. <span class="pull-right">
  434. <a href="#top">Back to top</a>
  435. </span>
  436. <span>Generated by <strong>DocFX</strong></span>
  437. </div>
  438. </div>
  439. </footer>
  440. </div>
  441. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  442. <script type="text/javascript" src="../styles/docfx.js"></script>
  443. <script type="text/javascript" src="../styles/main.js"></script>
  444. </body>
  445. </html>