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.

694 lines
38 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 UnityMainThreadTaskScheduler
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class UnityMainThreadTaskScheduler
  11. ">
  12. <meta name="generator" content="docfx 2.48.1.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.Async.UnityMainThreadTaskScheduler">
  75. <h1 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler" class="text-break">Class UnityMainThreadTaskScheduler
  76. </h1>
  77. <div class="markdown level0 summary"><p>A task scheduler that runs tasks on the Unity main thread via coroutines.</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"><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler">TaskScheduler</a></div>
  84. <div class="level2"><span class="xref">UnityMainThreadTaskScheduler</span></div>
  85. </div>
  86. <div classs="implements">
  87. <h5>Implements</h5>
  88. <div><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
  89. </div>
  90. <div class="inheritedMembers">
  91. <h5>Inherited Members</h5>
  92. <div>
  93. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.trydequeue#System_Threading_Tasks_TaskScheduler_TryDequeue_System_Threading_Tasks_Task_">TaskScheduler.TryDequeue(Task)</a>
  94. </div>
  95. <div>
  96. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.fromcurrentsynchronizationcontext#System_Threading_Tasks_TaskScheduler_FromCurrentSynchronizationContext">TaskScheduler.FromCurrentSynchronizationContext()</a>
  97. </div>
  98. <div>
  99. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.tryexecutetask#System_Threading_Tasks_TaskScheduler_TryExecuteTask_System_Threading_Tasks_Task_">TaskScheduler.TryExecuteTask(Task)</a>
  100. </div>
  101. <div>
  102. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.maximumconcurrencylevel#System_Threading_Tasks_TaskScheduler_MaximumConcurrencyLevel">TaskScheduler.MaximumConcurrencyLevel</a>
  103. </div>
  104. <div>
  105. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.current#System_Threading_Tasks_TaskScheduler_Current">TaskScheduler.Current</a>
  106. </div>
  107. <div>
  108. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.id#System_Threading_Tasks_TaskScheduler_Id">TaskScheduler.Id</a>
  109. </div>
  110. <div>
  111. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.unobservedtaskexception">TaskScheduler.UnobservedTaskException</a>
  112. </div>
  113. <div>
  114. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a>
  115. </div>
  116. <div>
  117. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_">Object.Equals(Object)</a>
  118. </div>
  119. <div>
  120. <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>
  121. </div>
  122. <div>
  123. <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>
  124. </div>
  125. <div>
  126. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gethashcode#System_Object_GetHashCode">Object.GetHashCode()</a>
  127. </div>
  128. <div>
  129. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gettype#System_Object_GetType">Object.GetType()</a>
  130. </div>
  131. <div>
  132. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.memberwiseclone#System_Object_MemberwiseClone">Object.MemberwiseClone()</a>
  133. </div>
  134. </div>
  135. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.Async.html">IPA.Utilities.Async</a></h6>
  136. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  137. <h5 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_syntax">Syntax</h5>
  138. <div class="codewrapper">
  139. <pre><code class="lang-csharp hljs">public class UnityMainThreadTaskScheduler : TaskScheduler, IDisposable</code></pre>
  140. </div>
  141. <h3 id="properties">Properties
  142. </h3>
  143. <span class="small pull-right mobile-hide">
  144. <span class="divider">|</span>
  145. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_Cancelling.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.Cancelling%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>
  146. </span>
  147. <span class="small pull-right mobile-hide">
  148. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L54">View Source</a>
  149. </span>
  150. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Cancelling_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Cancelling*"></a>
  151. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Cancelling" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Cancelling">Cancelling</h4>
  152. <div class="markdown level1 summary"><p>Gets whether or not this scheduler is in the process of shutting down.</p>
  153. </div>
  154. <div class="markdown level1 conceptual"></div>
  155. <h5 class="decalaration">Declaration</h5>
  156. <div class="codewrapper">
  157. <pre><code class="lang-csharp hljs">public bool Cancelling { get; }</code></pre>
  158. </div>
  159. <h5 class="propertyValue">Property Value</h5>
  160. <table class="table table-bordered table-striped table-condensed">
  161. <thead>
  162. <tr>
  163. <th>Type</th>
  164. <th>Description</th>
  165. </tr>
  166. </thead>
  167. <tbody>
  168. <tr>
  169. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  170. <td><p><span class="xref">true</span> if the scheduler is shutting down, <span class="xref">false</span> otherwise</p>
  171. </td>
  172. </tr>
  173. </tbody>
  174. </table>
  175. <span class="small pull-right mobile-hide">
  176. <span class="divider">|</span>
  177. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_Default.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.Default%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>
  178. </span>
  179. <span class="small pull-right mobile-hide">
  180. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L22">View Source</a>
  181. </span>
  182. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Default_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Default*"></a>
  183. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Default" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Default">Default</h4>
  184. <div class="markdown level1 summary"><p>Gets the default main thread scheduler that is managed by BSIPA.</p>
  185. </div>
  186. <div class="markdown level1 conceptual"></div>
  187. <h5 class="decalaration">Declaration</h5>
  188. <div class="codewrapper">
  189. <pre><code class="lang-csharp hljs">public static TaskScheduler Default { get; }</code></pre>
  190. </div>
  191. <h5 class="propertyValue">Property Value</h5>
  192. <table class="table table-bordered table-striped table-condensed">
  193. <thead>
  194. <tr>
  195. <th>Type</th>
  196. <th>Description</th>
  197. </tr>
  198. </thead>
  199. <tbody>
  200. <tr>
  201. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler">TaskScheduler</a></td>
  202. <td><p>a scheduler that is managed by BSIPA</p>
  203. </td>
  204. </tr>
  205. </tbody>
  206. </table>
  207. <span class="small pull-right mobile-hide">
  208. <span class="divider">|</span>
  209. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_IsRunning.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.IsRunning%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>
  210. </span>
  211. <span class="small pull-right mobile-hide">
  212. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L48">View Source</a>
  213. </span>
  214. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_IsRunning_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.IsRunning*"></a>
  215. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_IsRunning" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.IsRunning">IsRunning</h4>
  216. <div class="markdown level1 summary"><p>Gets whether or not this scheduler is currently executing tasks.</p>
  217. </div>
  218. <div class="markdown level1 conceptual"></div>
  219. <h5 class="decalaration">Declaration</h5>
  220. <div class="codewrapper">
  221. <pre><code class="lang-csharp hljs">public bool IsRunning { get; }</code></pre>
  222. </div>
  223. <h5 class="propertyValue">Property Value</h5>
  224. <table class="table table-bordered table-striped table-condensed">
  225. <thead>
  226. <tr>
  227. <th>Type</th>
  228. <th>Description</th>
  229. </tr>
  230. </thead>
  231. <tbody>
  232. <tr>
  233. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  234. <td><p><span class="xref">true</span> if the scheduler is running, <span class="xref">false</span> otherwise</p>
  235. </td>
  236. </tr>
  237. </tbody>
  238. </table>
  239. <span class="small pull-right mobile-hide">
  240. <span class="divider">|</span>
  241. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_YieldAfterTasks.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.YieldAfterTasks%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>
  242. </span>
  243. <span class="small pull-right mobile-hide">
  244. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L61">View Source</a>
  245. </span>
  246. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_YieldAfterTasks_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.YieldAfterTasks*"></a>
  247. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_YieldAfterTasks" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.YieldAfterTasks">YieldAfterTasks</h4>
  248. <div class="markdown level1 summary"><p>Gets or sets the number of tasks to execute before yielding back to Unity.</p>
  249. </div>
  250. <div class="markdown level1 conceptual"></div>
  251. <h5 class="decalaration">Declaration</h5>
  252. <div class="codewrapper">
  253. <pre><code class="lang-csharp hljs">public int YieldAfterTasks { get; set; }</code></pre>
  254. </div>
  255. <h5 class="propertyValue">Property Value</h5>
  256. <table class="table table-bordered table-striped table-condensed">
  257. <thead>
  258. <tr>
  259. <th>Type</th>
  260. <th>Description</th>
  261. </tr>
  262. </thead>
  263. <tbody>
  264. <tr>
  265. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.int32">Int32</a></td>
  266. <td><p>the number of tasks to execute per resume</p>
  267. </td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. <span class="small pull-right mobile-hide">
  272. <span class="divider">|</span>
  273. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_YieldAfterTime.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.YieldAfterTime%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>
  274. </span>
  275. <span class="small pull-right mobile-hide">
  276. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L78">View Source</a>
  277. </span>
  278. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_YieldAfterTime_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.YieldAfterTime*"></a>
  279. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_YieldAfterTime" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.YieldAfterTime">YieldAfterTime</h4>
  280. <div class="markdown level1 summary"><p>Gets or sets the amount of time to execute tasks for before yielding back to Unity. Default is 0.5ms.</p>
  281. </div>
  282. <div class="markdown level1 conceptual"></div>
  283. <h5 class="decalaration">Declaration</h5>
  284. <div class="codewrapper">
  285. <pre><code class="lang-csharp hljs">public TimeSpan YieldAfterTime { get; set; }</code></pre>
  286. </div>
  287. <h5 class="propertyValue">Property Value</h5>
  288. <table class="table table-bordered table-striped table-condensed">
  289. <thead>
  290. <tr>
  291. <th>Type</th>
  292. <th>Description</th>
  293. </tr>
  294. </thead>
  295. <tbody>
  296. <tr>
  297. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></td>
  298. <td><p>the amount of time to execute tasks for before yielding back to Unity</p>
  299. </td>
  300. </tr>
  301. </tbody>
  302. </table>
  303. <h3 id="methods">Methods
  304. </h3>
  305. <span class="small pull-right mobile-hide">
  306. <span class="divider">|</span>
  307. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_Cancel.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.Cancel%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/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L143">View Source</a>
  311. </span>
  312. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Cancel_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Cancel*"></a>
  313. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Cancel" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Cancel">Cancel()</h4>
  314. <div class="markdown level1 summary"><p>Cancels the scheduler. If the scheduler is currently executing tasks, that batch will finish first.
  315. All remaining tasks will be left in the queue.</p>
  316. </div>
  317. <div class="markdown level1 conceptual"></div>
  318. <h5 class="decalaration">Declaration</h5>
  319. <div class="codewrapper">
  320. <pre><code class="lang-csharp hljs">public void Cancel()</code></pre>
  321. </div>
  322. <h5 class="exceptions">Exceptions</h5>
  323. <table class="table table-bordered table-striped table-condensed">
  324. <thead>
  325. <tr>
  326. <th>Type</th>
  327. <th>Condition</th>
  328. </tr>
  329. </thead>
  330. <tbody>
  331. <tr>
  332. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.objectdisposedexception">ObjectDisposedException</a></td>
  333. <td><p>if this scheduler is disposed</p>
  334. </td>
  335. </tr>
  336. <tr>
  337. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
  338. <td><p>if the scheduler is not running</p>
  339. </td>
  340. </tr>
  341. </tbody>
  342. </table>
  343. <span class="small pull-right mobile-hide">
  344. <span class="divider">|</span>
  345. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_Coroutine.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.Coroutine%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>
  346. </span>
  347. <span class="small pull-right mobile-hide">
  348. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L96">View Source</a>
  349. </span>
  350. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Coroutine_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Coroutine*"></a>
  351. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Coroutine" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Coroutine">Coroutine()</h4>
  352. <div class="markdown level1 summary"><p>When used as a Unity coroutine, runs the scheduler. Otherwise, this is an invalid call.</p>
  353. </div>
  354. <div class="markdown level1 conceptual"></div>
  355. <h5 class="decalaration">Declaration</h5>
  356. <div class="codewrapper">
  357. <pre><code class="lang-csharp hljs">public IEnumerator Coroutine()</code></pre>
  358. </div>
  359. <h5 class="returns">Returns</h5>
  360. <table class="table table-bordered table-striped table-condensed">
  361. <thead>
  362. <tr>
  363. <th>Type</th>
  364. <th>Description</th>
  365. </tr>
  366. </thead>
  367. <tbody>
  368. <tr>
  369. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.collections.ienumerator">IEnumerator</a></td>
  370. <td><p>a Unity coroutine</p>
  371. </td>
  372. </tr>
  373. </tbody>
  374. </table>
  375. <h5 class="exceptions">Exceptions</h5>
  376. <table class="table table-bordered table-striped table-condensed">
  377. <thead>
  378. <tr>
  379. <th>Type</th>
  380. <th>Condition</th>
  381. </tr>
  382. </thead>
  383. <tbody>
  384. <tr>
  385. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.objectdisposedexception">ObjectDisposedException</a></td>
  386. <td><p>if this scheduler is disposed</p>
  387. </td>
  388. </tr>
  389. <tr>
  390. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
  391. <td><p>if the scheduler is already running</p>
  392. </td>
  393. </tr>
  394. </tbody>
  395. </table>
  396. <span class="small pull-right mobile-hide">
  397. <span class="divider">|</span>
  398. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_Dispose.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.Dispose%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>
  399. </span>
  400. <span class="small pull-right mobile-hide">
  401. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L222">View Source</a>
  402. </span>
  403. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Dispose_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Dispose*"></a>
  404. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Dispose" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Dispose">Dispose()</h4>
  405. <div class="markdown level1 summary"></div>
  406. <div class="markdown level1 conceptual"></div>
  407. <h5 class="decalaration">Declaration</h5>
  408. <div class="codewrapper">
  409. <pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
  410. </div>
  411. <span class="small pull-right mobile-hide">
  412. <span class="divider">|</span>
  413. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_Dispose_System_Boolean_.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.Dispose(System.Boolean)%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>
  414. </span>
  415. <span class="small pull-right mobile-hide">
  416. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L208">View Source</a>
  417. </span>
  418. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Dispose_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Dispose*"></a>
  419. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_Dispose_System_Boolean_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.Dispose(System.Boolean)">Dispose(Boolean)</h4>
  420. <div class="markdown level1 summary"></div>
  421. <div class="markdown level1 conceptual"></div>
  422. <h5 class="decalaration">Declaration</h5>
  423. <div class="codewrapper">
  424. <pre><code class="lang-csharp hljs">protected virtual void Dispose(bool disposing)</code></pre>
  425. </div>
  426. <h5 class="parameters">Parameters</h5>
  427. <table class="table table-bordered table-striped table-condensed">
  428. <thead>
  429. <tr>
  430. <th>Type</th>
  431. <th>Name</th>
  432. <th>Description</th>
  433. </tr>
  434. </thead>
  435. <tbody>
  436. <tr>
  437. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  438. <td><span class="parametername">disposing</span></td>
  439. <td></td>
  440. </tr>
  441. </tbody>
  442. </table>
  443. <span class="small pull-right mobile-hide">
  444. <span class="divider">|</span>
  445. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_GetScheduledTasks.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.GetScheduledTasks%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>
  446. </span>
  447. <span class="small pull-right mobile-hide">
  448. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L156">View Source</a>
  449. </span>
  450. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_GetScheduledTasks_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.GetScheduledTasks*"></a>
  451. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_GetScheduledTasks" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.GetScheduledTasks">GetScheduledTasks()</h4>
  452. <div class="markdown level1 summary"><p>Throws a <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.notsupportedexception">NotSupportedException</a>.</p>
  453. </div>
  454. <div class="markdown level1 conceptual"></div>
  455. <h5 class="decalaration">Declaration</h5>
  456. <div class="codewrapper">
  457. <pre><code class="lang-csharp hljs">protected override IEnumerable&lt;Task&gt; GetScheduledTasks()</code></pre>
  458. </div>
  459. <h5 class="returns">Returns</h5>
  460. <table class="table table-bordered table-striped table-condensed">
  461. <thead>
  462. <tr>
  463. <th>Type</th>
  464. <th>Description</th>
  465. </tr>
  466. </thead>
  467. <tbody>
  468. <tr>
  469. <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.threading.tasks.task">Task</a>&gt;</td>
  470. <td><p>nothing</p>
  471. </td>
  472. </tr>
  473. </tbody>
  474. </table>
  475. <h5 class="overrides">Overrides</h5>
  476. <div><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.getscheduledtasks#System_Threading_Tasks_TaskScheduler_GetScheduledTasks">TaskScheduler.GetScheduledTasks()</a></div>
  477. <h5 class="exceptions">Exceptions</h5>
  478. <table class="table table-bordered table-striped table-condensed">
  479. <thead>
  480. <tr>
  481. <th>Type</th>
  482. <th>Condition</th>
  483. </tr>
  484. </thead>
  485. <tbody>
  486. <tr>
  487. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.notsupportedexception">NotSupportedException</a></td>
  488. <td><p>Always.</p>
  489. </td>
  490. </tr>
  491. </tbody>
  492. </table>
  493. <span class="small pull-right mobile-hide">
  494. <span class="divider">|</span>
  495. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_QueueTask_System_Threading_Tasks_Task_.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.QueueTask(System.Threading.Tasks.Task)%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>
  496. </span>
  497. <span class="small pull-right mobile-hide">
  498. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L168">View Source</a>
  499. </span>
  500. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_QueueTask_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.QueueTask*"></a>
  501. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_QueueTask_System_Threading_Tasks_Task_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.QueueTask(System.Threading.Tasks.Task)">QueueTask(Task)</h4>
  502. <div class="markdown level1 summary"><p>Queues a given <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a> to this scheduler. The <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a> <em>must&gt;</em> be
  503. scheduled for this <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler">TaskScheduler</a> by the runtime.</p>
  504. </div>
  505. <div class="markdown level1 conceptual"></div>
  506. <h5 class="decalaration">Declaration</h5>
  507. <div class="codewrapper">
  508. <pre><code class="lang-csharp hljs">protected override void QueueTask(Task task)</code></pre>
  509. </div>
  510. <h5 class="parameters">Parameters</h5>
  511. <table class="table table-bordered table-striped table-condensed">
  512. <thead>
  513. <tr>
  514. <th>Type</th>
  515. <th>Name</th>
  516. <th>Description</th>
  517. </tr>
  518. </thead>
  519. <tbody>
  520. <tr>
  521. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
  522. <td><span class="parametername">task</span></td>
  523. <td><p>the <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a> to queue</p>
  524. </td>
  525. </tr>
  526. </tbody>
  527. </table>
  528. <h5 class="overrides">Overrides</h5>
  529. <div><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.queuetask#System_Threading_Tasks_TaskScheduler_QueueTask_System_Threading_Tasks_Task_">TaskScheduler.QueueTask(Task)</a></div>
  530. <h5 class="exceptions">Exceptions</h5>
  531. <table class="table table-bordered table-striped table-condensed">
  532. <thead>
  533. <tr>
  534. <th>Type</th>
  535. <th>Condition</th>
  536. </tr>
  537. </thead>
  538. <tbody>
  539. <tr>
  540. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.objectdisposedexception">ObjectDisposedException</a></td>
  541. <td><p>Thrown if this object has already been disposed.</p>
  542. </td>
  543. </tr>
  544. </tbody>
  545. </table>
  546. <span class="small pull-right mobile-hide">
  547. <span class="divider">|</span>
  548. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler_TryExecuteTaskInline_System_Threading_Tasks_Task_System_Boolean_.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task%2CSystem.Boolean)%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>
  549. </span>
  550. <span class="small pull-right mobile-hide">
  551. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L186">View Source</a>
  552. </span>
  553. <a id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_TryExecuteTaskInline_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.TryExecuteTaskInline*"></a>
  554. <h4 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_TryExecuteTaskInline_System_Threading_Tasks_Task_System_Boolean_" data-uid="IPA.Utilities.Async.UnityMainThreadTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task,System.Boolean)">TryExecuteTaskInline(Task, Boolean)</h4>
  555. <div class="markdown level1 summary"><p>Rejects any attempts to execute a task inline.</p>
  556. </div>
  557. <div class="markdown level1 conceptual"></div>
  558. <h5 class="decalaration">Declaration</h5>
  559. <div class="codewrapper">
  560. <pre><code class="lang-csharp hljs">protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)</code></pre>
  561. </div>
  562. <h5 class="parameters">Parameters</h5>
  563. <table class="table table-bordered table-striped table-condensed">
  564. <thead>
  565. <tr>
  566. <th>Type</th>
  567. <th>Name</th>
  568. <th>Description</th>
  569. </tr>
  570. </thead>
  571. <tbody>
  572. <tr>
  573. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
  574. <td><span class="parametername">task</span></td>
  575. <td><p>the task to attempt to execute</p>
  576. </td>
  577. </tr>
  578. <tr>
  579. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  580. <td><span class="parametername">taskWasPreviouslyQueued</span></td>
  581. <td><p>whether the task was previously queued to this scheduler</p>
  582. </td>
  583. </tr>
  584. </tbody>
  585. </table>
  586. <h5 class="returns">Returns</h5>
  587. <table class="table table-bordered table-striped table-condensed">
  588. <thead>
  589. <tr>
  590. <th>Type</th>
  591. <th>Description</th>
  592. </tr>
  593. </thead>
  594. <tbody>
  595. <tr>
  596. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.boolean">Boolean</a></td>
  597. <td><span class="xref">false</span></td>
  598. </tr>
  599. </tbody>
  600. </table>
  601. <h5 class="overrides">Overrides</h5>
  602. <div><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.threading.tasks.taskscheduler.tryexecutetaskinline#System_Threading_Tasks_TaskScheduler_TryExecuteTaskInline_System_Threading_Tasks_Task_System_Boolean_">TaskScheduler.TryExecuteTaskInline(Task, Boolean)</a></div>
  603. <h5 id="IPA_Utilities_Async_UnityMainThreadTaskScheduler_TryExecuteTaskInline_System_Threading_Tasks_Task_System_Boolean__remarks">Remarks</h5>
  604. <div class="markdown level1 remarks"><p>This task scheduler <em>always</em> runs its tasks on the thread that it manages, therefore it doesn&apos;t
  605. make sense to run it inline.</p>
  606. </div>
  607. <h5 class="exceptions">Exceptions</h5>
  608. <table class="table table-bordered table-striped table-condensed">
  609. <thead>
  610. <tr>
  611. <th>Type</th>
  612. <th>Condition</th>
  613. </tr>
  614. </thead>
  615. <tbody>
  616. <tr>
  617. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.objectdisposedexception">ObjectDisposedException</a></td>
  618. <td><p>Thrown if this object has already been disposed.</p>
  619. </td>
  620. </tr>
  621. </tbody>
  622. </table>
  623. <h3 id="implements">Implements</h3>
  624. <div>
  625. <a class="xref" href="https://docs.microsoft.com/dotnet/api/system.idisposable">System.IDisposable</a>
  626. </div>
  627. <h3 id="extensionmethods">Extension Methods</h3>
  628. <div>
  629. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetField__2___0_System_String___1_">ReflectionUtil.SetField&lt;T, U&gt;(T, String, U)</a>
  630. </div>
  631. <div>
  632. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetField__2___1_System_String_">ReflectionUtil.GetField&lt;U, T&gt;(T, String)</a>
  633. </div>
  634. <div>
  635. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetProperty__2___0_System_String___1_">ReflectionUtil.SetProperty&lt;T, U&gt;(T, String, U)</a>
  636. </div>
  637. <div>
  638. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetProperty__2___1_System_String_">ReflectionUtil.GetProperty&lt;U, T&gt;(T, String)</a>
  639. </div>
  640. <div>
  641. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object___">ReflectionUtil.InvokeMethod&lt;U, T&gt;(T, String, Object[])</a>
  642. </div>
  643. </article>
  644. </div>
  645. <div class="hidden-sm col-md-2" role="complementary">
  646. <div class="sideaffix">
  647. <div class="contribution">
  648. <ul class="nav">
  649. <li>
  650. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_Async_UnityMainThreadTaskScheduler.md&amp;value=---%0Auid%3A%20IPA.Utilities.Async.UnityMainThreadTaskScheduler%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>
  651. </li>
  652. <li>
  653. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/389aaebfa8758857e50d7c1b8dcfb1d57c394aab/IPA.Loader/Utilities/Async/UnityMainThreadTaskScheduler.cs/#L16" class="contribution-link">View Source</a>
  654. </li>
  655. </ul>
  656. </div>
  657. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  658. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  659. </nav>
  660. </div>
  661. </div>
  662. </div>
  663. </div>
  664. <footer>
  665. <div class="grad-bottom"></div>
  666. <div class="footer">
  667. <div class="container">
  668. <span class="pull-right">
  669. <a href="#top">Back to top</a>
  670. </span>
  671. <span>Generated by <strong>DocFX</strong></span>
  672. </div>
  673. </div>
  674. </footer>
  675. </div>
  676. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  677. <script type="text/javascript" src="../styles/docfx.js"></script>
  678. <script type="text/javascript" src="../styles/main.js"></script>
  679. </body>
  680. </html>