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.

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