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.

1152 lines
50 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 ReflectionUtil
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class ReflectionUtil
  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 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.Utilities.ReflectionUtil">
  74. <h1 id="IPA_Utilities_ReflectionUtil" data-uid="IPA.Utilities.ReflectionUtil" class="text-break">Class ReflectionUtil
  75. </h1>
  76. <div class="markdown level0 summary"><p>A utility class providing reflection helper methods.</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">ReflectionUtil</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.Utilities.html">IPA.Utilities</a></h6>
  109. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  110. <h5 id="IPA_Utilities_ReflectionUtil_syntax">Syntax</h5>
  111. <div class="codewrapper">
  112. <pre><code class="lang-csharp hljs">public static class ReflectionUtil</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/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_CopyComponent_UnityEngine_Component_System_Type_UnityEngine_GameObject_System_Type_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.CopyComponent(UnityEngine.Component%2CSystem.Type%2CUnityEngine.GameObject%2CSystem.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>
  119. </span>
  120. <span class="small pull-right mobile-hide">
  121. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L169">View Source</a>
  122. </span>
  123. <a id="IPA_Utilities_ReflectionUtil_CopyComponent_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent*"></a>
  124. <h4 id="IPA_Utilities_ReflectionUtil_CopyComponent_UnityEngine_Component_System_Type_UnityEngine_GameObject_System_Type_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent(UnityEngine.Component,System.Type,UnityEngine.GameObject,System.Type)">CopyComponent(Component, Type, GameObject, Type)</h4>
  125. <div class="markdown level1 summary"><p>Copies a component <code data-dev-comment-type="paramref" class="paramref">original</code> to a component of <code data-dev-comment-type="paramref" class="paramref">overridingType</code> on the destination <span class="xref">UnityEngine.GameObject</span>.</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 Component CopyComponent(this Component original, Type overridingType, GameObject destination, Type originalTypeOverride = null)</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><span class="xref">UnityEngine.Component</span></td>
  144. <td><span class="parametername">original</span></td>
  145. <td><p>the original component</p>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.type">Type</a></td>
  150. <td><span class="parametername">overridingType</span></td>
  151. <td><p>the new component&apos;s type</p>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td><span class="xref">UnityEngine.GameObject</span></td>
  156. <td><span class="parametername">destination</span></td>
  157. <td><p>the destination GameObject</p>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.type">Type</a></td>
  162. <td><span class="parametername">originalTypeOverride</span></td>
  163. <td><p>overrides the source component type (for example, to a superclass)</p>
  164. </td>
  165. </tr>
  166. </tbody>
  167. </table>
  168. <h5 class="returns">Returns</h5>
  169. <table class="table table-bordered table-striped table-condensed">
  170. <thead>
  171. <tr>
  172. <th>Type</th>
  173. <th>Description</th>
  174. </tr>
  175. </thead>
  176. <tbody>
  177. <tr>
  178. <td><span class="xref">UnityEngine.Component</span></td>
  179. <td><p>the copied component</p>
  180. </td>
  181. </tr>
  182. </tbody>
  183. </table>
  184. <span class="small pull-right mobile-hide">
  185. <span class="divider">|</span>
  186. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_CopyComponent__1_UnityEngine_Component_UnityEngine_GameObject_System_Type_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.CopyComponent%60%601(UnityEngine.Component%2CUnityEngine.GameObject%2CSystem.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>
  187. </span>
  188. <span class="small pull-right mobile-hide">
  189. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L193">View Source</a>
  190. </span>
  191. <a id="IPA_Utilities_ReflectionUtil_CopyComponent_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent*"></a>
  192. <h4 id="IPA_Utilities_ReflectionUtil_CopyComponent__1_UnityEngine_Component_UnityEngine_GameObject_System_Type_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent``1(UnityEngine.Component,UnityEngine.GameObject,System.Type)">CopyComponent&lt;T&gt;(Component, GameObject, Type)</h4>
  193. <div class="markdown level1 summary"><p>A generic version of <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_CopyComponent_UnityEngine_Component_System_Type_UnityEngine_GameObject_System_Type_">CopyComponent(Component, Type, GameObject, Type)</a>. </p>
  194. </div>
  195. <div class="markdown level1 conceptual"></div>
  196. <h5 class="decalaration">Declaration</h5>
  197. <div class="codewrapper">
  198. <pre><code class="lang-csharp hljs">public static T CopyComponent&lt;T&gt;(this Component original, GameObject destination, Type originalTypeOverride = null)
  199. where T : Component</code></pre>
  200. </div>
  201. <h5 class="parameters">Parameters</h5>
  202. <table class="table table-bordered table-striped table-condensed">
  203. <thead>
  204. <tr>
  205. <th>Type</th>
  206. <th>Name</th>
  207. <th>Description</th>
  208. </tr>
  209. </thead>
  210. <tbody>
  211. <tr>
  212. <td><span class="xref">UnityEngine.Component</span></td>
  213. <td><span class="parametername">original</span></td>
  214. <td><p>the original component</p>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td><span class="xref">UnityEngine.GameObject</span></td>
  219. <td><span class="parametername">destination</span></td>
  220. <td><p>the destination game object</p>
  221. </td>
  222. </tr>
  223. <tr>
  224. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.type">Type</a></td>
  225. <td><span class="parametername">originalTypeOverride</span></td>
  226. <td><p>overrides the source component type (for example, to a superclass)</p>
  227. </td>
  228. </tr>
  229. </tbody>
  230. </table>
  231. <h5 class="returns">Returns</h5>
  232. <table class="table table-bordered table-striped table-condensed">
  233. <thead>
  234. <tr>
  235. <th>Type</th>
  236. <th>Description</th>
  237. </tr>
  238. </thead>
  239. <tbody>
  240. <tr>
  241. <td><span class="xref">T</span></td>
  242. <td><p>the copied component</p>
  243. </td>
  244. </tr>
  245. </tbody>
  246. </table>
  247. <h5 class="typeParameters">Type Parameters</h5>
  248. <table class="table table-bordered table-striped table-condensed">
  249. <thead>
  250. <tr>
  251. <th>Name</th>
  252. <th>Description</th>
  253. </tr>
  254. </thead>
  255. <tbody>
  256. <tr>
  257. <td><span class="parametername">T</span></td>
  258. <td><p>the overriding type</p>
  259. </td>
  260. </tr>
  261. </tbody>
  262. </table>
  263. <h5 id="IPA_Utilities_ReflectionUtil_CopyComponent__1_UnityEngine_Component_UnityEngine_GameObject_System_Type__seealso">See Also</h5>
  264. <div class="seealso">
  265. <div><a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_CopyComponent_UnityEngine_Component_System_Type_UnityEngine_GameObject_System_Type_">CopyComponent(Component, Type, GameObject, Type)</a></div>
  266. </div>
  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/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_GetField__1_System_Object_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.GetField%60%601(System.Object%2CSystem.String)%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/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L49">View Source</a>
  273. </span>
  274. <a id="IPA_Utilities_ReflectionUtil_GetField_" data-uid="IPA.Utilities.ReflectionUtil.GetField*"></a>
  275. <h4 id="IPA_Utilities_ReflectionUtil_GetField__1_System_Object_System_String_" data-uid="IPA.Utilities.ReflectionUtil.GetField``1(System.Object,System.String)">GetField&lt;T&gt;(Object, String)</h4>
  276. <div class="markdown level1 summary"><p>Gets the value of a field.</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 T GetField&lt;T&gt;(this object obj, string fieldName)</code></pre>
  282. </div>
  283. <h5 class="parameters">Parameters</h5>
  284. <table class="table table-bordered table-striped table-condensed">
  285. <thead>
  286. <tr>
  287. <th>Type</th>
  288. <th>Name</th>
  289. <th>Description</th>
  290. </tr>
  291. </thead>
  292. <tbody>
  293. <tr>
  294. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  295. <td><span class="parametername">obj</span></td>
  296. <td><p>the object instance to pull from</p>
  297. </td>
  298. </tr>
  299. <tr>
  300. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  301. <td><span class="parametername">fieldName</span></td>
  302. <td><p>the name of the field to read</p>
  303. </td>
  304. </tr>
  305. </tbody>
  306. </table>
  307. <h5 class="returns">Returns</h5>
  308. <table class="table table-bordered table-striped table-condensed">
  309. <thead>
  310. <tr>
  311. <th>Type</th>
  312. <th>Description</th>
  313. </tr>
  314. </thead>
  315. <tbody>
  316. <tr>
  317. <td><span class="xref">T</span></td>
  318. <td><p>the value of the field</p>
  319. </td>
  320. </tr>
  321. </tbody>
  322. </table>
  323. <h5 class="typeParameters">Type Parameters</h5>
  324. <table class="table table-bordered table-striped table-condensed">
  325. <thead>
  326. <tr>
  327. <th>Name</th>
  328. <th>Description</th>
  329. </tr>
  330. </thead>
  331. <tbody>
  332. <tr>
  333. <td><span class="parametername">T</span></td>
  334. <td><p>the type of the field (result casted)</p>
  335. </td>
  336. </tr>
  337. </tbody>
  338. </table>
  339. <h5 class="exceptions">Exceptions</h5>
  340. <table class="table table-bordered table-striped table-condensed">
  341. <thead>
  342. <tr>
  343. <th>Type</th>
  344. <th>Condition</th>
  345. </tr>
  346. </thead>
  347. <tbody>
  348. <tr>
  349. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  350. <td><p>if <code data-dev-comment-type="paramref" class="paramref">fieldName</code> does not exist on the runtime type of <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  351. </td>
  352. </tr>
  353. </tbody>
  354. </table>
  355. <span class="small pull-right mobile-hide">
  356. <span class="divider">|</span>
  357. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_GetField__2___1_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.GetField%60%602(%60%601%2CSystem.String)%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>
  358. </span>
  359. <span class="small pull-right mobile-hide">
  360. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L66">View Source</a>
  361. </span>
  362. <a id="IPA_Utilities_ReflectionUtil_GetField_" data-uid="IPA.Utilities.ReflectionUtil.GetField*"></a>
  363. <h4 id="IPA_Utilities_ReflectionUtil_GetField__2___1_System_String_" data-uid="IPA.Utilities.ReflectionUtil.GetField``2(``1,System.String)">GetField&lt;T, U&gt;(U, String)</h4>
  364. <div class="markdown level1 summary"><p>Gets the value of a field.</p>
  365. </div>
  366. <div class="markdown level1 conceptual"></div>
  367. <h5 class="decalaration">Declaration</h5>
  368. <div class="codewrapper">
  369. <pre><code class="lang-csharp hljs">public static T GetField&lt;T, U&gt;(this U obj, string fieldName)</code></pre>
  370. </div>
  371. <h5 class="parameters">Parameters</h5>
  372. <table class="table table-bordered table-striped table-condensed">
  373. <thead>
  374. <tr>
  375. <th>Type</th>
  376. <th>Name</th>
  377. <th>Description</th>
  378. </tr>
  379. </thead>
  380. <tbody>
  381. <tr>
  382. <td><span class="xref">U</span></td>
  383. <td><span class="parametername">obj</span></td>
  384. <td><p>the object instance to pull from</p>
  385. </td>
  386. </tr>
  387. <tr>
  388. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  389. <td><span class="parametername">fieldName</span></td>
  390. <td><p>the name of the field to read</p>
  391. </td>
  392. </tr>
  393. </tbody>
  394. </table>
  395. <h5 class="returns">Returns</h5>
  396. <table class="table table-bordered table-striped table-condensed">
  397. <thead>
  398. <tr>
  399. <th>Type</th>
  400. <th>Description</th>
  401. </tr>
  402. </thead>
  403. <tbody>
  404. <tr>
  405. <td><span class="xref">T</span></td>
  406. <td><p>the value of the field</p>
  407. </td>
  408. </tr>
  409. </tbody>
  410. </table>
  411. <h5 class="typeParameters">Type Parameters</h5>
  412. <table class="table table-bordered table-striped table-condensed">
  413. <thead>
  414. <tr>
  415. <th>Name</th>
  416. <th>Description</th>
  417. </tr>
  418. </thead>
  419. <tbody>
  420. <tr>
  421. <td><span class="parametername">T</span></td>
  422. <td><p>the type of the field (result casted)</p>
  423. </td>
  424. </tr>
  425. <tr>
  426. <td><span class="parametername">U</span></td>
  427. <td><p>the type to get the field from</p>
  428. </td>
  429. </tr>
  430. </tbody>
  431. </table>
  432. <h5 class="exceptions">Exceptions</h5>
  433. <table class="table table-bordered table-striped table-condensed">
  434. <thead>
  435. <tr>
  436. <th>Type</th>
  437. <th>Condition</th>
  438. </tr>
  439. </thead>
  440. <tbody>
  441. <tr>
  442. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  443. <td><p>if <code data-dev-comment-type="paramref" class="paramref">fieldName</code> does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">U</code></p>
  444. </td>
  445. </tr>
  446. </tbody>
  447. </table>
  448. <span class="small pull-right mobile-hide">
  449. <span class="divider">|</span>
  450. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_InvokeMethod_System_Object_System_String_System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.InvokeMethod(System.Object%2CSystem.String%2CSystem.Object%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>
  451. </span>
  452. <span class="small pull-right mobile-hide">
  453. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L111">View Source</a>
  454. </span>
  455. <a id="IPA_Utilities_ReflectionUtil_InvokeMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod*"></a>
  456. <h4 id="IPA_Utilities_ReflectionUtil_InvokeMethod_System_Object_System_String_System_Object___" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod(System.Object,System.String,System.Object[])">InvokeMethod(Object, String, Object[])</h4>
  457. <div class="markdown level1 summary"><p>Invokes a method on an object.</p>
  458. </div>
  459. <div class="markdown level1 conceptual"></div>
  460. <h5 class="decalaration">Declaration</h5>
  461. <div class="codewrapper">
  462. <pre><code class="lang-csharp hljs">public static object InvokeMethod(this object obj, string methodName, params object[] methodArgs)</code></pre>
  463. </div>
  464. <h5 class="parameters">Parameters</h5>
  465. <table class="table table-bordered table-striped table-condensed">
  466. <thead>
  467. <tr>
  468. <th>Type</th>
  469. <th>Name</th>
  470. <th>Description</th>
  471. </tr>
  472. </thead>
  473. <tbody>
  474. <tr>
  475. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  476. <td><span class="parametername">obj</span></td>
  477. <td><p>the object to call from</p>
  478. </td>
  479. </tr>
  480. <tr>
  481. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  482. <td><span class="parametername">methodName</span></td>
  483. <td><p>the method name</p>
  484. </td>
  485. </tr>
  486. <tr>
  487. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>[]</td>
  488. <td><span class="parametername">methodArgs</span></td>
  489. <td><p>the method arguments</p>
  490. </td>
  491. </tr>
  492. </tbody>
  493. </table>
  494. <h5 class="returns">Returns</h5>
  495. <table class="table table-bordered table-striped table-condensed">
  496. <thead>
  497. <tr>
  498. <th>Type</th>
  499. <th>Description</th>
  500. </tr>
  501. </thead>
  502. <tbody>
  503. <tr>
  504. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  505. <td><p>the return value</p>
  506. </td>
  507. </tr>
  508. </tbody>
  509. </table>
  510. <h5 class="exceptions">Exceptions</h5>
  511. <table class="table table-bordered table-striped table-condensed">
  512. <thead>
  513. <tr>
  514. <th>Type</th>
  515. <th>Condition</th>
  516. </tr>
  517. </thead>
  518. <tbody>
  519. <tr>
  520. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  521. <td><p>if <code data-dev-comment-type="paramref" class="paramref">methodName</code> does not exist on the runtime type of <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  522. </td>
  523. </tr>
  524. </tbody>
  525. </table>
  526. <span class="small pull-right mobile-hide">
  527. <span class="divider">|</span>
  528. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_InvokeMethod__1___0_System_String_System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.InvokeMethod%60%601(%60%600%2CSystem.String%2CSystem.Object%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>
  529. </span>
  530. <span class="small pull-right mobile-hide">
  531. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L127">View Source</a>
  532. </span>
  533. <a id="IPA_Utilities_ReflectionUtil_InvokeMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod*"></a>
  534. <h4 id="IPA_Utilities_ReflectionUtil_InvokeMethod__1___0_System_String_System_Object___" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod``1(``0,System.String,System.Object[])">InvokeMethod&lt;T&gt;(T, String, Object[])</h4>
  535. <div class="markdown level1 summary"><p>Invokes a method from <code data-dev-comment-type="typeparamref" class="typeparamref">T</code> on an object.</p>
  536. </div>
  537. <div class="markdown level1 conceptual"></div>
  538. <h5 class="decalaration">Declaration</h5>
  539. <div class="codewrapper">
  540. <pre><code class="lang-csharp hljs">public static object InvokeMethod&lt;T&gt;(this T obj, string methodName, params object[] args)</code></pre>
  541. </div>
  542. <h5 class="parameters">Parameters</h5>
  543. <table class="table table-bordered table-striped table-condensed">
  544. <thead>
  545. <tr>
  546. <th>Type</th>
  547. <th>Name</th>
  548. <th>Description</th>
  549. </tr>
  550. </thead>
  551. <tbody>
  552. <tr>
  553. <td><span class="xref">T</span></td>
  554. <td><span class="parametername">obj</span></td>
  555. <td><p>the object instance</p>
  556. </td>
  557. </tr>
  558. <tr>
  559. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  560. <td><span class="parametername">methodName</span></td>
  561. <td><p>the method&apos;s name</p>
  562. </td>
  563. </tr>
  564. <tr>
  565. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>[]</td>
  566. <td><span class="parametername">args</span></td>
  567. <td><p>the method arguments</p>
  568. </td>
  569. </tr>
  570. </tbody>
  571. </table>
  572. <h5 class="returns">Returns</h5>
  573. <table class="table table-bordered table-striped table-condensed">
  574. <thead>
  575. <tr>
  576. <th>Type</th>
  577. <th>Description</th>
  578. </tr>
  579. </thead>
  580. <tbody>
  581. <tr>
  582. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  583. <td><p>the return value</p>
  584. </td>
  585. </tr>
  586. </tbody>
  587. </table>
  588. <h5 class="typeParameters">Type Parameters</h5>
  589. <table class="table table-bordered table-striped table-condensed">
  590. <thead>
  591. <tr>
  592. <th>Name</th>
  593. <th>Description</th>
  594. </tr>
  595. </thead>
  596. <tbody>
  597. <tr>
  598. <td><span class="parametername">T</span></td>
  599. <td><p>the type to search for the method on</p>
  600. </td>
  601. </tr>
  602. </tbody>
  603. </table>
  604. <h5 class="exceptions">Exceptions</h5>
  605. <table class="table table-bordered table-striped table-condensed">
  606. <thead>
  607. <tr>
  608. <th>Type</th>
  609. <th>Condition</th>
  610. </tr>
  611. </thead>
  612. <tbody>
  613. <tr>
  614. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  615. <td><p>if <code data-dev-comment-type="paramref" class="paramref">methodName</code> does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  616. </td>
  617. </tr>
  618. </tbody>
  619. </table>
  620. <span class="small pull-right mobile-hide">
  621. <span class="divider">|</span>
  622. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_InvokeMethod__1_System_Object_System_String_System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.InvokeMethod%60%601(System.Object%2CSystem.String%2CSystem.Object%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>
  623. </span>
  624. <span class="small pull-right mobile-hide">
  625. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L144">View Source</a>
  626. </span>
  627. <a id="IPA_Utilities_ReflectionUtil_InvokeMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod*"></a>
  628. <h4 id="IPA_Utilities_ReflectionUtil_InvokeMethod__1_System_Object_System_String_System_Object___" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod``1(System.Object,System.String,System.Object[])">InvokeMethod&lt;T&gt;(Object, String, Object[])</h4>
  629. <div class="markdown level1 summary"><p>Invokes a method.</p>
  630. </div>
  631. <div class="markdown level1 conceptual"></div>
  632. <h5 class="decalaration">Declaration</h5>
  633. <div class="codewrapper">
  634. <pre><code class="lang-csharp hljs">public static T InvokeMethod&lt;T&gt;(this object obj, string methodName, params object[] methodArgs)</code></pre>
  635. </div>
  636. <h5 class="parameters">Parameters</h5>
  637. <table class="table table-bordered table-striped table-condensed">
  638. <thead>
  639. <tr>
  640. <th>Type</th>
  641. <th>Name</th>
  642. <th>Description</th>
  643. </tr>
  644. </thead>
  645. <tbody>
  646. <tr>
  647. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  648. <td><span class="parametername">obj</span></td>
  649. <td><p>the object instance</p>
  650. </td>
  651. </tr>
  652. <tr>
  653. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  654. <td><span class="parametername">methodName</span></td>
  655. <td><p>the method name to call</p>
  656. </td>
  657. </tr>
  658. <tr>
  659. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>[]</td>
  660. <td><span class="parametername">methodArgs</span></td>
  661. <td><p>the method&apos;s arguments</p>
  662. </td>
  663. </tr>
  664. </tbody>
  665. </table>
  666. <h5 class="returns">Returns</h5>
  667. <table class="table table-bordered table-striped table-condensed">
  668. <thead>
  669. <tr>
  670. <th>Type</th>
  671. <th>Description</th>
  672. </tr>
  673. </thead>
  674. <tbody>
  675. <tr>
  676. <td><span class="xref">T</span></td>
  677. <td><p>the return value</p>
  678. </td>
  679. </tr>
  680. </tbody>
  681. </table>
  682. <h5 class="typeParameters">Type Parameters</h5>
  683. <table class="table table-bordered table-striped table-condensed">
  684. <thead>
  685. <tr>
  686. <th>Name</th>
  687. <th>Description</th>
  688. </tr>
  689. </thead>
  690. <tbody>
  691. <tr>
  692. <td><span class="parametername">T</span></td>
  693. <td><p>the return type</p>
  694. </td>
  695. </tr>
  696. </tbody>
  697. </table>
  698. <h5 class="exceptions">Exceptions</h5>
  699. <table class="table table-bordered table-striped table-condensed">
  700. <thead>
  701. <tr>
  702. <th>Type</th>
  703. <th>Condition</th>
  704. </tr>
  705. </thead>
  706. <tbody>
  707. <tr>
  708. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  709. <td><p>if <code data-dev-comment-type="paramref" class="paramref">methodName</code> does not exist on the runtime type of <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  710. </td>
  711. </tr>
  712. </tbody>
  713. </table>
  714. <h5 id="IPA_Utilities_ReflectionUtil_InvokeMethod__1_System_Object_System_String_System_Object____seealso">See Also</h5>
  715. <div class="seealso">
  716. <div><a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod_System_Object_System_String_System_Object___">InvokeMethod(Object, String, Object[])</a></div>
  717. </div>
  718. <span class="small pull-right mobile-hide">
  719. <span class="divider">|</span>
  720. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.InvokeMethod%60%602(%60%601%2CSystem.String%2CSystem.Object%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>
  721. </span>
  722. <span class="small pull-right mobile-hide">
  723. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L158">View Source</a>
  724. </span>
  725. <a id="IPA_Utilities_ReflectionUtil_InvokeMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod*"></a>
  726. <h4 id="IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object___" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod``2(``1,System.String,System.Object[])">InvokeMethod&lt;T, U&gt;(U, String, Object[])</h4>
  727. <div class="markdown level1 summary"><p>Invokes a method from <code data-dev-comment-type="typeparamref" class="typeparamref">U</code> on an object.</p>
  728. </div>
  729. <div class="markdown level1 conceptual"></div>
  730. <h5 class="decalaration">Declaration</h5>
  731. <div class="codewrapper">
  732. <pre><code class="lang-csharp hljs">public static T InvokeMethod&lt;T, U&gt;(this U obj, string methodName, params object[] methodArgs)</code></pre>
  733. </div>
  734. <h5 class="parameters">Parameters</h5>
  735. <table class="table table-bordered table-striped table-condensed">
  736. <thead>
  737. <tr>
  738. <th>Type</th>
  739. <th>Name</th>
  740. <th>Description</th>
  741. </tr>
  742. </thead>
  743. <tbody>
  744. <tr>
  745. <td><span class="xref">U</span></td>
  746. <td><span class="parametername">obj</span></td>
  747. <td><p>the object instance</p>
  748. </td>
  749. </tr>
  750. <tr>
  751. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  752. <td><span class="parametername">methodName</span></td>
  753. <td><p>the method name to call</p>
  754. </td>
  755. </tr>
  756. <tr>
  757. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>[]</td>
  758. <td><span class="parametername">methodArgs</span></td>
  759. <td><p>the method&apos;s arguments</p>
  760. </td>
  761. </tr>
  762. </tbody>
  763. </table>
  764. <h5 class="returns">Returns</h5>
  765. <table class="table table-bordered table-striped table-condensed">
  766. <thead>
  767. <tr>
  768. <th>Type</th>
  769. <th>Description</th>
  770. </tr>
  771. </thead>
  772. <tbody>
  773. <tr>
  774. <td><span class="xref">T</span></td>
  775. <td><p>the return value</p>
  776. </td>
  777. </tr>
  778. </tbody>
  779. </table>
  780. <h5 class="typeParameters">Type Parameters</h5>
  781. <table class="table table-bordered table-striped table-condensed">
  782. <thead>
  783. <tr>
  784. <th>Name</th>
  785. <th>Description</th>
  786. </tr>
  787. </thead>
  788. <tbody>
  789. <tr>
  790. <td><span class="parametername">T</span></td>
  791. <td><p>the return type</p>
  792. </td>
  793. </tr>
  794. <tr>
  795. <td><span class="parametername">U</span></td>
  796. <td><p>the type to search for the method on</p>
  797. </td>
  798. </tr>
  799. </tbody>
  800. </table>
  801. <h5 class="exceptions">Exceptions</h5>
  802. <table class="table table-bordered table-striped table-condensed">
  803. <thead>
  804. <tr>
  805. <th>Type</th>
  806. <th>Condition</th>
  807. </tr>
  808. </thead>
  809. <tbody>
  810. <tr>
  811. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  812. <td><p>if <code data-dev-comment-type="paramref" class="paramref">methodName</code> does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">U</code></p>
  813. </td>
  814. </tr>
  815. </tbody>
  816. </table>
  817. <h5 id="IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object____seealso">See Also</h5>
  818. <div class="seealso">
  819. <div><a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod__1___0_System_String_System_Object___">InvokeMethod&lt;T&gt;(T, String, Object[])</a></div>
  820. </div>
  821. <span class="small pull-right mobile-hide">
  822. <span class="divider">|</span>
  823. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_SetField_System_Object_System_String_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetField(System.Object%2CSystem.String%2CSystem.Object)%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>
  824. </span>
  825. <span class="small pull-right mobile-hide">
  826. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L19">View Source</a>
  827. </span>
  828. <a id="IPA_Utilities_ReflectionUtil_SetField_" data-uid="IPA.Utilities.ReflectionUtil.SetField*"></a>
  829. <h4 id="IPA_Utilities_ReflectionUtil_SetField_System_Object_System_String_System_Object_" data-uid="IPA.Utilities.ReflectionUtil.SetField(System.Object,System.String,System.Object)">SetField(Object, String, Object)</h4>
  830. <div class="markdown level1 summary"><p>Sets a field on the target object.</p>
  831. </div>
  832. <div class="markdown level1 conceptual"></div>
  833. <h5 class="decalaration">Declaration</h5>
  834. <div class="codewrapper">
  835. <pre><code class="lang-csharp hljs">public static void SetField(this object obj, string fieldName, object value)</code></pre>
  836. </div>
  837. <h5 class="parameters">Parameters</h5>
  838. <table class="table table-bordered table-striped table-condensed">
  839. <thead>
  840. <tr>
  841. <th>Type</th>
  842. <th>Name</th>
  843. <th>Description</th>
  844. </tr>
  845. </thead>
  846. <tbody>
  847. <tr>
  848. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  849. <td><span class="parametername">obj</span></td>
  850. <td><p>the object instance</p>
  851. </td>
  852. </tr>
  853. <tr>
  854. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  855. <td><span class="parametername">fieldName</span></td>
  856. <td><p>the field to set</p>
  857. </td>
  858. </tr>
  859. <tr>
  860. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  861. <td><span class="parametername">value</span></td>
  862. <td><p>the value to set it to</p>
  863. </td>
  864. </tr>
  865. </tbody>
  866. </table>
  867. <h5 class="exceptions">Exceptions</h5>
  868. <table class="table table-bordered table-striped table-condensed">
  869. <thead>
  870. <tr>
  871. <th>Type</th>
  872. <th>Condition</th>
  873. </tr>
  874. </thead>
  875. <tbody>
  876. <tr>
  877. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  878. <td><p>if <code data-dev-comment-type="paramref" class="paramref">fieldName</code> does not exist on the runtime type of <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  879. </td>
  880. </tr>
  881. </tbody>
  882. </table>
  883. <span class="small pull-right mobile-hide">
  884. <span class="divider">|</span>
  885. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_SetField__1___0_System_String_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetField%60%601(%60%600%2CSystem.String%2CSystem.Object)%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>
  886. </span>
  887. <span class="small pull-right mobile-hide">
  888. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L34">View Source</a>
  889. </span>
  890. <a id="IPA_Utilities_ReflectionUtil_SetField_" data-uid="IPA.Utilities.ReflectionUtil.SetField*"></a>
  891. <h4 id="IPA_Utilities_ReflectionUtil_SetField__1___0_System_String_System_Object_" data-uid="IPA.Utilities.ReflectionUtil.SetField``1(``0,System.String,System.Object)">SetField&lt;T&gt;(T, String, Object)</h4>
  892. <div class="markdown level1 summary"><p>Sets a field on the target object, as gotten from <code data-dev-comment-type="typeparamref" class="typeparamref">T</code>.</p>
  893. </div>
  894. <div class="markdown level1 conceptual"></div>
  895. <h5 class="decalaration">Declaration</h5>
  896. <div class="codewrapper">
  897. <pre><code class="lang-csharp hljs">public static void SetField&lt;T&gt;(this T obj, string fieldName, object value)</code></pre>
  898. </div>
  899. <h5 class="parameters">Parameters</h5>
  900. <table class="table table-bordered table-striped table-condensed">
  901. <thead>
  902. <tr>
  903. <th>Type</th>
  904. <th>Name</th>
  905. <th>Description</th>
  906. </tr>
  907. </thead>
  908. <tbody>
  909. <tr>
  910. <td><span class="xref">T</span></td>
  911. <td><span class="parametername">obj</span></td>
  912. <td><p>the object instance</p>
  913. </td>
  914. </tr>
  915. <tr>
  916. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  917. <td><span class="parametername">fieldName</span></td>
  918. <td><p>the field to set</p>
  919. </td>
  920. </tr>
  921. <tr>
  922. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  923. <td><span class="parametername">value</span></td>
  924. <td><p>the value to set it to</p>
  925. </td>
  926. </tr>
  927. </tbody>
  928. </table>
  929. <h5 class="typeParameters">Type Parameters</h5>
  930. <table class="table table-bordered table-striped table-condensed">
  931. <thead>
  932. <tr>
  933. <th>Name</th>
  934. <th>Description</th>
  935. </tr>
  936. </thead>
  937. <tbody>
  938. <tr>
  939. <td><span class="parametername">T</span></td>
  940. <td><p>the type to get the field from</p>
  941. </td>
  942. </tr>
  943. </tbody>
  944. </table>
  945. <h5 class="exceptions">Exceptions</h5>
  946. <table class="table table-bordered table-striped table-condensed">
  947. <thead>
  948. <tr>
  949. <th>Type</th>
  950. <th>Condition</th>
  951. </tr>
  952. </thead>
  953. <tbody>
  954. <tr>
  955. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  956. <td><p>if <code data-dev-comment-type="paramref" class="paramref">fieldName</code> does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  957. </td>
  958. </tr>
  959. </tbody>
  960. </table>
  961. <span class="small pull-right mobile-hide">
  962. <span class="divider">|</span>
  963. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_SetProperty_System_Object_System_String_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetProperty(System.Object%2CSystem.String%2CSystem.Object)%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>
  964. </span>
  965. <span class="small pull-right mobile-hide">
  966. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L81">View Source</a>
  967. </span>
  968. <a id="IPA_Utilities_ReflectionUtil_SetProperty_" data-uid="IPA.Utilities.ReflectionUtil.SetProperty*"></a>
  969. <h4 id="IPA_Utilities_ReflectionUtil_SetProperty_System_Object_System_String_System_Object_" data-uid="IPA.Utilities.ReflectionUtil.SetProperty(System.Object,System.String,System.Object)">SetProperty(Object, String, Object)</h4>
  970. <div class="markdown level1 summary"><p>Sets a property on the target object.</p>
  971. </div>
  972. <div class="markdown level1 conceptual"></div>
  973. <h5 class="decalaration">Declaration</h5>
  974. <div class="codewrapper">
  975. <pre><code class="lang-csharp hljs">public static void SetProperty(this object obj, string propertyName, object value)</code></pre>
  976. </div>
  977. <h5 class="parameters">Parameters</h5>
  978. <table class="table table-bordered table-striped table-condensed">
  979. <thead>
  980. <tr>
  981. <th>Type</th>
  982. <th>Name</th>
  983. <th>Description</th>
  984. </tr>
  985. </thead>
  986. <tbody>
  987. <tr>
  988. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  989. <td><span class="parametername">obj</span></td>
  990. <td><p>the target object instance</p>
  991. </td>
  992. </tr>
  993. <tr>
  994. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  995. <td><span class="parametername">propertyName</span></td>
  996. <td><p>the name of the property</p>
  997. </td>
  998. </tr>
  999. <tr>
  1000. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  1001. <td><span class="parametername">value</span></td>
  1002. <td><p>the value to set it to</p>
  1003. </td>
  1004. </tr>
  1005. </tbody>
  1006. </table>
  1007. <h5 class="exceptions">Exceptions</h5>
  1008. <table class="table table-bordered table-striped table-condensed">
  1009. <thead>
  1010. <tr>
  1011. <th>Type</th>
  1012. <th>Condition</th>
  1013. </tr>
  1014. </thead>
  1015. <tbody>
  1016. <tr>
  1017. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  1018. <td><p>if <code data-dev-comment-type="paramref" class="paramref">propertyName</code> does not exist on the runtime type of <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  1019. </td>
  1020. </tr>
  1021. </tbody>
  1022. </table>
  1023. <span class="small pull-right mobile-hide">
  1024. <span class="divider">|</span>
  1025. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_SetProperty__1___0_System_String_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetProperty%60%601(%60%600%2CSystem.String%2CSystem.Object)%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>
  1026. </span>
  1027. <span class="small pull-right mobile-hide">
  1028. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L96">View Source</a>
  1029. </span>
  1030. <a id="IPA_Utilities_ReflectionUtil_SetProperty_" data-uid="IPA.Utilities.ReflectionUtil.SetProperty*"></a>
  1031. <h4 id="IPA_Utilities_ReflectionUtil_SetProperty__1___0_System_String_System_Object_" data-uid="IPA.Utilities.ReflectionUtil.SetProperty``1(``0,System.String,System.Object)">SetProperty&lt;T&gt;(T, String, Object)</h4>
  1032. <div class="markdown level1 summary"><p>Sets a property on the target object, as gotten from <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  1033. </div>
  1034. <div class="markdown level1 conceptual"></div>
  1035. <h5 class="decalaration">Declaration</h5>
  1036. <div class="codewrapper">
  1037. <pre><code class="lang-csharp hljs">public static void SetProperty&lt;T&gt;(this T obj, string propertyName, object value)</code></pre>
  1038. </div>
  1039. <h5 class="parameters">Parameters</h5>
  1040. <table class="table table-bordered table-striped table-condensed">
  1041. <thead>
  1042. <tr>
  1043. <th>Type</th>
  1044. <th>Name</th>
  1045. <th>Description</th>
  1046. </tr>
  1047. </thead>
  1048. <tbody>
  1049. <tr>
  1050. <td><span class="xref">T</span></td>
  1051. <td><span class="parametername">obj</span></td>
  1052. <td><p>the object instance</p>
  1053. </td>
  1054. </tr>
  1055. <tr>
  1056. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  1057. <td><span class="parametername">propertyName</span></td>
  1058. <td><p>the property to set</p>
  1059. </td>
  1060. </tr>
  1061. <tr>
  1062. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  1063. <td><span class="parametername">value</span></td>
  1064. <td><p>the value to set it to</p>
  1065. </td>
  1066. </tr>
  1067. </tbody>
  1068. </table>
  1069. <h5 class="typeParameters">Type Parameters</h5>
  1070. <table class="table table-bordered table-striped table-condensed">
  1071. <thead>
  1072. <tr>
  1073. <th>Name</th>
  1074. <th>Description</th>
  1075. </tr>
  1076. </thead>
  1077. <tbody>
  1078. <tr>
  1079. <td><span class="parametername">T</span></td>
  1080. <td><p>the type to get the property from</p>
  1081. </td>
  1082. </tr>
  1083. </tbody>
  1084. </table>
  1085. <h5 class="exceptions">Exceptions</h5>
  1086. <table class="table table-bordered table-striped table-condensed">
  1087. <thead>
  1088. <tr>
  1089. <th>Type</th>
  1090. <th>Condition</th>
  1091. </tr>
  1092. </thead>
  1093. <tbody>
  1094. <tr>
  1095. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  1096. <td><p>if <code data-dev-comment-type="paramref" class="paramref">propertyName</code> does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  1097. </td>
  1098. </tr>
  1099. </tbody>
  1100. </table>
  1101. </article>
  1102. </div>
  1103. <div class="hidden-sm col-md-2" role="complementary">
  1104. <div class="sideaffix">
  1105. <div class="contribution">
  1106. <ul class="nav">
  1107. <li>
  1108. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil%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>
  1109. </li>
  1110. <li>
  1111. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/9705692cbf53e5b1f7667f378696cf6ea482054b/IPA.Loader/Utilities/ReflectionUtil.cs/#L10" class="contribution-link">View Source</a>
  1112. </li>
  1113. </ul>
  1114. </div>
  1115. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  1116. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  1117. </nav>
  1118. </div>
  1119. </div>
  1120. </div>
  1121. </div>
  1122. <footer>
  1123. <div class="grad-bottom"></div>
  1124. <div class="footer">
  1125. <div class="container">
  1126. <span class="pull-right">
  1127. <a href="#top">Back to top</a>
  1128. </span>
  1129. <span>Generated by <strong>DocFX</strong></span>
  1130. </div>
  1131. </div>
  1132. </footer>
  1133. </div>
  1134. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  1135. <script type="text/javascript" src="../styles/docfx.js"></script>
  1136. <script type="text/javascript" src="../styles/main.js"></script>
  1137. </body>
  1138. </html>