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.

386 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 Config
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Config
  11. ">
  12. <meta name="generator" content="docfx 2.42.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 href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
  18. <meta property="docfx:navrel" content="../toc.html">
  19. <meta property="docfx:tocrel" content="toc.html">
  20. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  21. <div id="wrapper">
  22. <header>
  23. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  24. <div class="container">
  25. <div class="navbar-header">
  26. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  27. <span class="sr-only">Toggle navigation</span>
  28. <span class="icon-bar"></span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. </button>
  32. <a class="navbar-brand" href="../index.html">
  33. <img id="logo" class="svg" src="../logo.svg" alt="">
  34. </a>
  35. </div>
  36. <div class="collapse navbar-collapse" id="navbar">
  37. <form class="navbar-form navbar-right" role="search" id="search">
  38. <div class="form-group">
  39. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </nav>
  45. <div class="subnav navbar navbar-default">
  46. <div class="container hide-when-search" id="breadcrumb">
  47. <ul class="breadcrumb">
  48. <li></li>
  49. </ul>
  50. </div>
  51. </div>
  52. </header>
  53. <div role="main" class="container body-content hide-when-search">
  54. <div class="sidenav hide-when-search">
  55. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  56. <div class="sidetoggle collapse" id="sidetoggle">
  57. <div id="sidetoc"></div>
  58. </div>
  59. </div>
  60. <div class="article row grid-right">
  61. <div class="col-md-10">
  62. <article class="content wrap" id="_content" data-uid="IPA.Config.Config">
  63. <h1 id="IPA_Config_Config" data-uid="IPA.Config.Config" class="text-break">Class Config
  64. </h1>
  65. <div class="markdown level0 summary"><p>A class to handle updating ConfigProviders automatically</p>
  66. </div>
  67. <div class="markdown level0 conceptual"></div>
  68. <div class="inheritance">
  69. <h5>Inheritance</h5>
  70. <div class="level0"><span class="xref">System.Object</span></div>
  71. <div class="level1"><span class="xref">Config</span></div>
  72. </div>
  73. <div class="inheritedMembers">
  74. <h5>Inherited Members</h5>
  75. <div>
  76. <span class="xref">System.Object.ToString()</span>
  77. </div>
  78. <div>
  79. <span class="xref">System.Object.Equals(System.Object)</span>
  80. </div>
  81. <div>
  82. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  83. </div>
  84. <div>
  85. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  86. </div>
  87. <div>
  88. <span class="xref">System.Object.GetHashCode()</span>
  89. </div>
  90. <div>
  91. <span class="xref">System.Object.GetType()</span>
  92. </div>
  93. <div>
  94. <span class="xref">System.Object.MemberwiseClone()</span>
  95. </div>
  96. </div>
  97. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Config.html">IPA.Config</a></h6>
  98. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  99. <h5 id="IPA_Config_Config_syntax">Syntax</h5>
  100. <div class="codewrapper">
  101. <pre><code class="lang-csharp hljs">public static class Config</code></pre>
  102. </div>
  103. <h3 id="methods">Methods
  104. </h3>
  105. <span class="small pull-right mobile-hide">
  106. <span class="divider">|</span>
  107. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Config_Config_GetProviderFor_System_String_System_String___.md&amp;value=---%0Auid%3A%20IPA.Config.Config.GetProviderFor(System.String%2CSystem.String%5B%5D)%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>
  108. </span>
  109. <span class="small pull-right mobile-hide">
  110. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Config/Config.cs/#L126">View Source</a>
  111. </span>
  112. <a id="IPA_Config_Config_GetProviderFor_" data-uid="IPA.Config.Config.GetProviderFor*"></a>
  113. <h4 id="IPA_Config_Config_GetProviderFor_System_String_System_String___" data-uid="IPA.Config.Config.GetProviderFor(System.String,System.String[])">GetProviderFor(String, String[])</h4>
  114. <div class="markdown level1 summary"><p>Gets an <a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a> using the specified list of preferred config types.</p>
  115. </div>
  116. <div class="markdown level1 conceptual"></div>
  117. <h5 class="decalaration">Declaration</h5>
  118. <div class="codewrapper">
  119. <pre><code class="lang-csharp hljs">public static IConfigProvider GetProviderFor(string configName, params string[] extensions)</code></pre>
  120. </div>
  121. <h5 class="parameters">Parameters</h5>
  122. <table class="table table-bordered table-striped table-condensed">
  123. <thead>
  124. <tr>
  125. <th>Type</th>
  126. <th>Name</th>
  127. <th>Description</th>
  128. </tr>
  129. </thead>
  130. <tbody>
  131. <tr>
  132. <td><span class="xref">System.String</span></td>
  133. <td><span class="parametername">configName</span></td>
  134. <td><p>the name of the mod for this config</p>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td><span class="xref">System.String</span>[]</td>
  139. <td><span class="parametername">extensions</span></td>
  140. <td><p>the preferred config types to try to get</p>
  141. </td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. <h5 class="returns">Returns</h5>
  146. <table class="table table-bordered table-striped table-condensed">
  147. <thead>
  148. <tr>
  149. <th>Type</th>
  150. <th>Description</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. <tr>
  155. <td><a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a></td>
  156. <td><p>an <a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a> of the requested type, or of type JSON.</p>
  157. </td>
  158. </tr>
  159. </tbody>
  160. </table>
  161. <span class="small pull-right mobile-hide">
  162. <span class="divider">|</span>
  163. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Config_Config_MakeLink__1_IPA_Config_IConfigProvider_System_Action_IPA_Config_IConfigProvider_IPA_Utilities_Ref___0___.md&amp;value=---%0Auid%3A%20IPA.Config.Config.MakeLink%60%601(IPA.Config.IConfigProvider%2CSystem.Action%7BIPA.Config.IConfigProvider%2CIPA.Utilities.Ref%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>
  164. </span>
  165. <span class="small pull-right mobile-hide">
  166. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Config/Config.cs/#L161">View Source</a>
  167. </span>
  168. <a id="IPA_Config_Config_MakeLink_" data-uid="IPA.Config.Config.MakeLink*"></a>
  169. <h4 id="IPA_Config_Config_MakeLink__1_IPA_Config_IConfigProvider_System_Action_IPA_Config_IConfigProvider_IPA_Utilities_Ref___0___" data-uid="IPA.Config.Config.MakeLink``1(IPA.Config.IConfigProvider,System.Action{IPA.Config.IConfigProvider,IPA.Utilities.Ref{``0}})">MakeLink&lt;T&gt;(IConfigProvider, Action&lt;IConfigProvider, Ref&lt;T&gt;&gt;)</h4>
  170. <div class="markdown level1 summary"><p>Creates a linked <a class="xref" href="IPA.Utilities.Ref-1.html">Ref&lt;T&gt;</a> for the config provider. This <a class="xref" href="IPA.Utilities.Ref-1.html">Ref&lt;T&gt;</a> will be automatically updated whenever the file on-disk changes.</p>
  171. </div>
  172. <div class="markdown level1 conceptual"></div>
  173. <h5 class="decalaration">Declaration</h5>
  174. <div class="codewrapper">
  175. <pre><code class="lang-csharp hljs">public static Ref&lt;T&gt; MakeLink&lt;T&gt;(this IConfigProvider config, Action&lt;IConfigProvider, Ref&lt;T&gt;&gt; onChange = null)</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><a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a></td>
  189. <td><span class="parametername">config</span></td>
  190. <td><p>the <a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a> to create a link to</p>
  191. </td>
  192. </tr>
  193. <tr>
  194. <td><span class="xref">System.Action</span>&lt;<a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a>, <a class="xref" href="IPA.Utilities.Ref-1.html">Ref</a>&lt;T&gt;&gt;</td>
  195. <td><span class="parametername">onChange</span></td>
  196. <td><p>an action to perform on value change</p>
  197. </td>
  198. </tr>
  199. </tbody>
  200. </table>
  201. <h5 class="returns">Returns</h5>
  202. <table class="table table-bordered table-striped table-condensed">
  203. <thead>
  204. <tr>
  205. <th>Type</th>
  206. <th>Description</th>
  207. </tr>
  208. </thead>
  209. <tbody>
  210. <tr>
  211. <td><a class="xref" href="IPA.Utilities.Ref-1.html">Ref</a>&lt;T&gt;</td>
  212. <td><p>a <a class="xref" href="IPA.Utilities.Ref-1.html">Ref&lt;T&gt;</a> to an ever-changing value, mirroring whatever the file contains.</p>
  213. </td>
  214. </tr>
  215. </tbody>
  216. </table>
  217. <h5 class="typeParameters">Type Parameters</h5>
  218. <table class="table table-bordered table-striped table-condensed">
  219. <thead>
  220. <tr>
  221. <th>Name</th>
  222. <th>Description</th>
  223. </tr>
  224. </thead>
  225. <tbody>
  226. <tr>
  227. <td><span class="parametername">T</span></td>
  228. <td><p>the type of the parsed value</p>
  229. </td>
  230. </tr>
  231. </tbody>
  232. </table>
  233. <span class="small pull-right mobile-hide">
  234. <span class="divider">|</span>
  235. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Config_Config_Register_System_Type_.md&amp;value=---%0Auid%3A%20IPA.Config.Config.Register(System.Type)%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>
  236. </span>
  237. <span class="small pull-right mobile-hide">
  238. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Config/Config.cs/#L104">View Source</a>
  239. </span>
  240. <a id="IPA_Config_Config_Register_" data-uid="IPA.Config.Config.Register*"></a>
  241. <h4 id="IPA_Config_Config_Register_System_Type_" data-uid="IPA.Config.Config.Register(System.Type)">Register(Type)</h4>
  242. <div class="markdown level1 summary"><p>Registers a <a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a> to use for configs.</p>
  243. </div>
  244. <div class="markdown level1 conceptual"></div>
  245. <h5 class="decalaration">Declaration</h5>
  246. <div class="codewrapper">
  247. <pre><code class="lang-csharp hljs">public static void Register(Type type)</code></pre>
  248. </div>
  249. <h5 class="parameters">Parameters</h5>
  250. <table class="table table-bordered table-striped table-condensed">
  251. <thead>
  252. <tr>
  253. <th>Type</th>
  254. <th>Name</th>
  255. <th>Description</th>
  256. </tr>
  257. </thead>
  258. <tbody>
  259. <tr>
  260. <td><span class="xref">System.Type</span></td>
  261. <td><span class="parametername">type</span></td>
  262. <td><p>the type to register</p>
  263. </td>
  264. </tr>
  265. </tbody>
  266. </table>
  267. <span class="small pull-right mobile-hide">
  268. <span class="divider">|</span>
  269. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Config_Config_Register__1.md&amp;value=---%0Auid%3A%20IPA.Config.Config.Register%60%601%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>
  270. </span>
  271. <span class="small pull-right mobile-hide">
  272. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Config/Config.cs/#L98">View Source</a>
  273. </span>
  274. <a id="IPA_Config_Config_Register_" data-uid="IPA.Config.Config.Register*"></a>
  275. <h4 id="IPA_Config_Config_Register__1" data-uid="IPA.Config.Config.Register``1">Register&lt;T&gt;()</h4>
  276. <div class="markdown level1 summary"><p>Registers a <a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a> to use for configs.</p>
  277. </div>
  278. <div class="markdown level1 conceptual"></div>
  279. <h5 class="decalaration">Declaration</h5>
  280. <div class="codewrapper">
  281. <pre><code class="lang-csharp hljs">public static void Register&lt;T&gt;()
  282. where T : IConfigProvider</code></pre>
  283. </div>
  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 to register</p>
  296. </td>
  297. </tr>
  298. </tbody>
  299. </table>
  300. <span class="small pull-right mobile-hide">
  301. <span class="divider">|</span>
  302. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Config_Config_RemoveLinks_IPA_Config_IConfigProvider_.md&amp;value=---%0Auid%3A%20IPA.Config.Config.RemoveLinks(IPA.Config.IConfigProvider)%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>
  303. </span>
  304. <span class="small pull-right mobile-hide">
  305. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Config/Config.cs/#L184">View Source</a>
  306. </span>
  307. <a id="IPA_Config_Config_RemoveLinks_" data-uid="IPA.Config.Config.RemoveLinks*"></a>
  308. <h4 id="IPA_Config_Config_RemoveLinks_IPA_Config_IConfigProvider_" data-uid="IPA.Config.Config.RemoveLinks(IPA.Config.IConfigProvider)">RemoveLinks(IConfigProvider)</h4>
  309. <div class="markdown level1 summary"><p>Removes all linked <a class="xref" href="IPA.Utilities.Ref-1.html">Ref&lt;T&gt;</a> such that they are no longer updated.</p>
  310. </div>
  311. <div class="markdown level1 conceptual"></div>
  312. <h5 class="decalaration">Declaration</h5>
  313. <div class="codewrapper">
  314. <pre><code class="lang-csharp hljs">public static void RemoveLinks(this IConfigProvider config)</code></pre>
  315. </div>
  316. <h5 class="parameters">Parameters</h5>
  317. <table class="table table-bordered table-striped table-condensed">
  318. <thead>
  319. <tr>
  320. <th>Type</th>
  321. <th>Name</th>
  322. <th>Description</th>
  323. </tr>
  324. </thead>
  325. <tbody>
  326. <tr>
  327. <td><a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a></td>
  328. <td><span class="parametername">config</span></td>
  329. <td><p>the <a class="xref" href="IPA.Config.IConfigProvider.html">IConfigProvider</a> to unlink</p>
  330. </td>
  331. </tr>
  332. </tbody>
  333. </table>
  334. </article>
  335. </div>
  336. <div class="hidden-sm col-md-2" role="complementary">
  337. <div class="sideaffix">
  338. <div class="contribution">
  339. <ul class="nav">
  340. <li>
  341. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Config_Config.md&amp;value=---%0Auid%3A%20IPA.Config.Config%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>
  342. </li>
  343. <li>
  344. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Config/Config.cs/#L14" class="contribution-link">View Source</a>
  345. </li>
  346. </ul>
  347. </div>
  348. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  349. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  350. </nav>
  351. </div>
  352. </div>
  353. </div>
  354. </div>
  355. <footer>
  356. <div class="grad-bottom"></div>
  357. <div class="footer">
  358. <div class="container">
  359. <span class="pull-right">
  360. <a href="#top">Back to top</a>
  361. </span>
  362. <span>Generated by <strong>DocFX</strong></span>
  363. </div>
  364. </div>
  365. </footer>
  366. </div>
  367. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  368. <script type="text/javascript" src="../styles/docfx.js"></script>
  369. <script type="text/javascript" src="../styles/main.js"></script>
  370. </body>
  371. </html>