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.

602 lines
27 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.48.0.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"></div>
  59. <div class="sr-items">
  60. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  61. </div>
  62. <ul id="pagination"></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 <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> 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. <div class="inheritedMembers">
  86. <h5>Inherited Members</h5>
  87. <div>
  88. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a>
  89. </div>
  90. <div>
  91. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_">Object.Equals(Object)</a>
  92. </div>
  93. <div>
  94. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_System_Object_">Object.Equals(Object, Object)</a>
  95. </div>
  96. <div>
  97. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.referenceequals#System_Object_ReferenceEquals_System_Object_System_Object_">Object.ReferenceEquals(Object, Object)</a>
  98. </div>
  99. <div>
  100. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gethashcode#System_Object_GetHashCode">Object.GetHashCode()</a>
  101. </div>
  102. <div>
  103. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gettype#System_Object_GetType">Object.GetType()</a>
  104. </div>
  105. <div>
  106. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.memberwiseclone#System_Object_MemberwiseClone">Object.MemberwiseClone()</a>
  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/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_Append__1_System_Collections_Generic_IEnumerable___0____0_.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.Append%60%601(System.Collections.Generic.IEnumerable%7B%60%600%7D%2C%60%600)%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/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/EnumerableExtensions.cs/#L98">View Source</a>
  123. </span>
  124. <a id="IPA_Utilities_EnumerableExtensions_Append_" data-uid="IPA.Utilities.EnumerableExtensions.Append*"></a>
  125. <h4 id="IPA_Utilities_EnumerableExtensions_Append__1_System_Collections_Generic_IEnumerable___0____0_" data-uid="IPA.Utilities.EnumerableExtensions.Append``1(System.Collections.Generic.IEnumerable{``0},``0)">Append&lt;T&gt;(IEnumerable&lt;T&gt;, T)</h4>
  126. <div class="markdown level1 summary"><p>Adds a value to the end of the sequence.</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; Append&lt;T&gt;(this IEnumerable&lt;T&gt; seq, T app)</code></pre>
  132. </div>
  133. <h5 class="parameters">Parameters</h5>
  134. <table class="table table-bordered table-striped table-condensed">
  135. <thead>
  136. <tr>
  137. <th>Type</th>
  138. <th>Name</th>
  139. <th>Description</th>
  140. </tr>
  141. </thead>
  142. <tbody>
  143. <tr>
  144. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  145. <td><span class="parametername">seq</span></td>
  146. <td><p>a sequence of values</p>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td><span class="xref">T</span></td>
  151. <td><span class="parametername">app</span></td>
  152. <td><p>the value to append to <code data-dev-comment-type="paramref" class="paramref">seq</code></p>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. <h5 class="returns">Returns</h5>
  158. <table class="table table-bordered table-striped table-condensed">
  159. <thead>
  160. <tr>
  161. <th>Type</th>
  162. <th>Description</th>
  163. </tr>
  164. </thead>
  165. <tbody>
  166. <tr>
  167. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  168. <td><p>a new sequence ending with <code data-dev-comment-type="paramref" class="paramref">app</code></p>
  169. </td>
  170. </tr>
  171. </tbody>
  172. </table>
  173. <h5 class="typeParameters">Type Parameters</h5>
  174. <table class="table table-bordered table-striped table-condensed">
  175. <thead>
  176. <tr>
  177. <th>Name</th>
  178. <th>Description</th>
  179. </tr>
  180. </thead>
  181. <tbody>
  182. <tr>
  183. <td><span class="parametername">T</span></td>
  184. <td><p>the type of the elements of <code data-dev-comment-type="paramref" class="paramref">seq</code></p>
  185. </td>
  186. </tr>
  187. </tbody>
  188. </table>
  189. <span class="small pull-right mobile-hide">
  190. <span class="divider">|</span>
  191. <a href="https://github.com/bsmg/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>
  192. </span>
  193. <span class="small pull-right mobile-hide">
  194. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/EnumerableExtensions.cs/#L173">View Source</a>
  195. </span>
  196. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  197. <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>
  198. <div class="markdown level1 summary"><p>LINQ-style extension method that filters <span class="xref">null</span> elements out of an enumeration.</p>
  199. </div>
  200. <div class="markdown level1 conceptual"></div>
  201. <h5 class="decalaration">Declaration</h5>
  202. <div class="codewrapper">
  203. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T&gt;(this IEnumerable&lt;T&gt; self)
  204. where T : class</code></pre>
  205. </div>
  206. <h5 class="parameters">Parameters</h5>
  207. <table class="table table-bordered table-striped table-condensed">
  208. <thead>
  209. <tr>
  210. <th>Type</th>
  211. <th>Name</th>
  212. <th>Description</th>
  213. </tr>
  214. </thead>
  215. <tbody>
  216. <tr>
  217. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  218. <td><span class="parametername">self</span></td>
  219. <td><p>the enumeration to filter</p>
  220. </td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. <h5 class="returns">Returns</h5>
  225. <table class="table table-bordered table-striped table-condensed">
  226. <thead>
  227. <tr>
  228. <th>Type</th>
  229. <th>Description</th>
  230. </tr>
  231. </thead>
  232. <tbody>
  233. <tr>
  234. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  235. <td><p>a filtered enumerable</p>
  236. </td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. <h5 class="typeParameters">Type Parameters</h5>
  241. <table class="table table-bordered table-striped table-condensed">
  242. <thead>
  243. <tr>
  244. <th>Name</th>
  245. <th>Description</th>
  246. </tr>
  247. </thead>
  248. <tbody>
  249. <tr>
  250. <td><span class="parametername">T</span></td>
  251. <td><p>the type of the enumeration</p>
  252. </td>
  253. </tr>
  254. </tbody>
  255. </table>
  256. <span class="small pull-right mobile-hide">
  257. <span class="divider">|</span>
  258. <a href="https://github.com/bsmg/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>
  259. </span>
  260. <span class="small pull-right mobile-hide">
  261. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/EnumerableExtensions.cs/#L193">View Source</a>
  262. </span>
  263. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  264. <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>
  265. <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>
  266. </div>
  267. <div class="markdown level1 conceptual"></div>
  268. <h5 class="decalaration">Declaration</h5>
  269. <div class="codewrapper">
  270. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; NonNull&lt;T&gt;(this IEnumerable&lt;T?&gt; self)
  271. where T : struct</code></pre>
  272. </div>
  273. <h5 class="parameters">Parameters</h5>
  274. <table class="table table-bordered table-striped table-condensed">
  275. <thead>
  276. <tr>
  277. <th>Type</th>
  278. <th>Name</th>
  279. <th>Description</th>
  280. </tr>
  281. </thead>
  282. <tbody>
  283. <tr>
  284. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.nullable-1">Nullable</a>&lt;T&gt;&gt;</td>
  285. <td><span class="parametername">self</span></td>
  286. <td><p>the enumeration to filter</p>
  287. </td>
  288. </tr>
  289. </tbody>
  290. </table>
  291. <h5 class="returns">Returns</h5>
  292. <table class="table table-bordered table-striped table-condensed">
  293. <thead>
  294. <tr>
  295. <th>Type</th>
  296. <th>Description</th>
  297. </tr>
  298. </thead>
  299. <tbody>
  300. <tr>
  301. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  302. <td><p>a filtered enumerable</p>
  303. </td>
  304. </tr>
  305. </tbody>
  306. </table>
  307. <h5 class="typeParameters">Type Parameters</h5>
  308. <table class="table table-bordered table-striped table-condensed">
  309. <thead>
  310. <tr>
  311. <th>Name</th>
  312. <th>Description</th>
  313. </tr>
  314. </thead>
  315. <tbody>
  316. <tr>
  317. <td><span class="parametername">T</span></td>
  318. <td><p>the underlying type of the nullable enumeration</p>
  319. </td>
  320. </tr>
  321. </tbody>
  322. </table>
  323. <span class="small pull-right mobile-hide">
  324. <span class="divider">|</span>
  325. <a href="https://github.com/bsmg/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>
  326. </span>
  327. <span class="small pull-right mobile-hide">
  328. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/EnumerableExtensions.cs/#L184">View Source</a>
  329. </span>
  330. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  331. <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>
  332. <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>
  333. </div>
  334. <div class="markdown level1 conceptual"></div>
  335. <h5 class="decalaration">Declaration</h5>
  336. <div class="codewrapper">
  337. <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)
  338. where U : class</code></pre>
  339. </div>
  340. <h5 class="parameters">Parameters</h5>
  341. <table class="table table-bordered table-striped table-condensed">
  342. <thead>
  343. <tr>
  344. <th>Type</th>
  345. <th>Name</th>
  346. <th>Description</th>
  347. </tr>
  348. </thead>
  349. <tbody>
  350. <tr>
  351. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  352. <td><span class="parametername">self</span></td>
  353. <td><p>the enumeration to filter</p>
  354. </td>
  355. </tr>
  356. <tr>
  357. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, U&gt;</td>
  358. <td><span class="parametername">pred</span></td>
  359. <td><p>the predicate to select for filtering</p>
  360. </td>
  361. </tr>
  362. </tbody>
  363. </table>
  364. <h5 class="returns">Returns</h5>
  365. <table class="table table-bordered table-striped table-condensed">
  366. <thead>
  367. <tr>
  368. <th>Type</th>
  369. <th>Description</th>
  370. </tr>
  371. </thead>
  372. <tbody>
  373. <tr>
  374. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  375. <td><p>a filtered enumerable</p>
  376. </td>
  377. </tr>
  378. </tbody>
  379. </table>
  380. <h5 class="typeParameters">Type Parameters</h5>
  381. <table class="table table-bordered table-striped table-condensed">
  382. <thead>
  383. <tr>
  384. <th>Name</th>
  385. <th>Description</th>
  386. </tr>
  387. </thead>
  388. <tbody>
  389. <tr>
  390. <td><span class="parametername">T</span></td>
  391. <td><p>the type of the enumeration</p>
  392. </td>
  393. </tr>
  394. <tr>
  395. <td><span class="parametername">U</span></td>
  396. <td><p>the type to compare to null</p>
  397. </td>
  398. </tr>
  399. </tbody>
  400. </table>
  401. <span class="small pull-right mobile-hide">
  402. <span class="divider">|</span>
  403. <a href="https://github.com/bsmg/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>
  404. </span>
  405. <span class="small pull-right mobile-hide">
  406. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/EnumerableExtensions.cs/#L204">View Source</a>
  407. </span>
  408. <a id="IPA_Utilities_EnumerableExtensions_NonNull_" data-uid="IPA.Utilities.EnumerableExtensions.NonNull*"></a>
  409. <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>
  410. <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>
  411. </div>
  412. <div class="markdown level1 conceptual"></div>
  413. <h5 class="decalaration">Declaration</h5>
  414. <div class="codewrapper">
  415. <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)
  416. where U : struct</code></pre>
  417. </div>
  418. <h5 class="parameters">Parameters</h5>
  419. <table class="table table-bordered table-striped table-condensed">
  420. <thead>
  421. <tr>
  422. <th>Type</th>
  423. <th>Name</th>
  424. <th>Description</th>
  425. </tr>
  426. </thead>
  427. <tbody>
  428. <tr>
  429. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  430. <td><span class="parametername">self</span></td>
  431. <td><p>the enumeration to filter</p>
  432. </td>
  433. </tr>
  434. <tr>
  435. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.nullable-1">Nullable</a>&lt;U&gt;&gt;</td>
  436. <td><span class="parametername">pred</span></td>
  437. <td><p>the predicate to select for filtering</p>
  438. </td>
  439. </tr>
  440. </tbody>
  441. </table>
  442. <h5 class="returns">Returns</h5>
  443. <table class="table table-bordered table-striped table-condensed">
  444. <thead>
  445. <tr>
  446. <th>Type</th>
  447. <th>Description</th>
  448. </tr>
  449. </thead>
  450. <tbody>
  451. <tr>
  452. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  453. <td><p>a filtered enumerable</p>
  454. </td>
  455. </tr>
  456. </tbody>
  457. </table>
  458. <h5 class="typeParameters">Type Parameters</h5>
  459. <table class="table table-bordered table-striped table-condensed">
  460. <thead>
  461. <tr>
  462. <th>Name</th>
  463. <th>Description</th>
  464. </tr>
  465. </thead>
  466. <tbody>
  467. <tr>
  468. <td><span class="parametername">T</span></td>
  469. <td><p>the type of the enumeration</p>
  470. </td>
  471. </tr>
  472. <tr>
  473. <td><span class="parametername">U</span></td>
  474. <td><p>the type of the predicate&apos;s resulting nullable</p>
  475. </td>
  476. </tr>
  477. </tbody>
  478. </table>
  479. <span class="small pull-right mobile-hide">
  480. <span class="divider">|</span>
  481. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_EnumerableExtensions_Prepend__1_System_Collections_Generic_IEnumerable___0____0_.md&amp;value=---%0Auid%3A%20IPA.Utilities.EnumerableExtensions.Prepend%60%601(System.Collections.Generic.IEnumerable%7B%60%600%7D%2C%60%600)%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>
  482. </span>
  483. <span class="small pull-right mobile-hide">
  484. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/EnumerableExtensions.cs/#L22">View Source</a>
  485. </span>
  486. <a id="IPA_Utilities_EnumerableExtensions_Prepend_" data-uid="IPA.Utilities.EnumerableExtensions.Prepend*"></a>
  487. <h4 id="IPA_Utilities_EnumerableExtensions_Prepend__1_System_Collections_Generic_IEnumerable___0____0_" data-uid="IPA.Utilities.EnumerableExtensions.Prepend``1(System.Collections.Generic.IEnumerable{``0},``0)">Prepend&lt;T&gt;(IEnumerable&lt;T&gt;, T)</h4>
  488. <div class="markdown level1 summary"><p>Adds a value to the beginning of the sequence.</p>
  489. </div>
  490. <div class="markdown level1 conceptual"></div>
  491. <h5 class="decalaration">Declaration</h5>
  492. <div class="codewrapper">
  493. <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; Prepend&lt;T&gt;(this IEnumerable&lt;T&gt; seq, T prep)</code></pre>
  494. </div>
  495. <h5 class="parameters">Parameters</h5>
  496. <table class="table table-bordered table-striped table-condensed">
  497. <thead>
  498. <tr>
  499. <th>Type</th>
  500. <th>Name</th>
  501. <th>Description</th>
  502. </tr>
  503. </thead>
  504. <tbody>
  505. <tr>
  506. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  507. <td><span class="parametername">seq</span></td>
  508. <td><p>a sequence of values</p>
  509. </td>
  510. </tr>
  511. <tr>
  512. <td><span class="xref">T</span></td>
  513. <td><span class="parametername">prep</span></td>
  514. <td><p>the value to prepend to <code data-dev-comment-type="paramref" class="paramref">seq</code></p>
  515. </td>
  516. </tr>
  517. </tbody>
  518. </table>
  519. <h5 class="returns">Returns</h5>
  520. <table class="table table-bordered table-striped table-condensed">
  521. <thead>
  522. <tr>
  523. <th>Type</th>
  524. <th>Description</th>
  525. </tr>
  526. </thead>
  527. <tbody>
  528. <tr>
  529. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
  530. <td><p>a new sequence beginning with <code data-dev-comment-type="paramref" class="paramref">prep</code></p>
  531. </td>
  532. </tr>
  533. </tbody>
  534. </table>
  535. <h5 class="typeParameters">Type Parameters</h5>
  536. <table class="table table-bordered table-striped table-condensed">
  537. <thead>
  538. <tr>
  539. <th>Name</th>
  540. <th>Description</th>
  541. </tr>
  542. </thead>
  543. <tbody>
  544. <tr>
  545. <td><span class="parametername">T</span></td>
  546. <td><p>the type of the elements of <code data-dev-comment-type="paramref" class="paramref">seq</code></p>
  547. </td>
  548. </tr>
  549. </tbody>
  550. </table>
  551. </article>
  552. </div>
  553. <div class="hidden-sm col-md-2" role="complementary">
  554. <div class="sideaffix">
  555. <div class="contribution">
  556. <ul class="nav">
  557. <li>
  558. <a href="https://github.com/bsmg/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>
  559. </li>
  560. <li>
  561. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/a368881e207c0db8b0a92e9273cb8feb50c9f647/IPA.Loader/Utilities/EnumerableExtensions.cs/#L13" class="contribution-link">View Source</a>
  562. </li>
  563. </ul>
  564. </div>
  565. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  566. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  567. </nav>
  568. </div>
  569. </div>
  570. </div>
  571. </div>
  572. <footer>
  573. <div class="grad-bottom"></div>
  574. <div class="footer">
  575. <div class="container">
  576. <span class="pull-right">
  577. <a href="#top">Back to top</a>
  578. </span>
  579. <span>Generated by <strong>DocFX</strong></span>
  580. </div>
  581. </div>
  582. </footer>
  583. </div>
  584. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  585. <script type="text/javascript" src="../styles/docfx.js"></script>
  586. <script type="text/javascript" src="../styles/main.js"></script>
  587. </body>
  588. </html>