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.

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