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.

884 lines
38 KiB

  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class 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/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L106">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/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L130">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__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>
  271. </span>
  272. <span class="small pull-right mobile-hide">
  273. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L39">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__2___1_System_String_" data-uid="IPA.Utilities.ReflectionUtil.GetField``2(``1,System.String)">GetField&lt;T, U&gt;(U, 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, U&gt;(this U 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><span class="xref">U</span></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. <tr>
  339. <td><span class="parametername">U</span></td>
  340. <td><p>the type to get the field from</p>
  341. </td>
  342. </tr>
  343. </tbody>
  344. </table>
  345. <h5 class="exceptions">Exceptions</h5>
  346. <table class="table table-bordered table-striped table-condensed">
  347. <thead>
  348. <tr>
  349. <th>Type</th>
  350. <th>Condition</th>
  351. </tr>
  352. </thead>
  353. <tbody>
  354. <tr>
  355. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  356. <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>
  357. </td>
  358. </tr>
  359. </tbody>
  360. </table>
  361. <h5 id="IPA_Utilities_ReflectionUtil_GetField__2___1_System_String__seealso">See Also</h5>
  362. <div class="seealso">
  363. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Get__0__System_String_">Get(ref T, String)</a></div>
  364. </div>
  365. <span class="small pull-right mobile-hide">
  366. <span class="divider">|</span>
  367. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_Utilities_ReflectionUtil_GetProperty__2___0_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.GetProperty%60%602(%60%600%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>
  368. </span>
  369. <span class="small pull-right mobile-hide">
  370. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L65">View Source</a>
  371. </span>
  372. <a id="IPA_Utilities_ReflectionUtil_GetProperty_" data-uid="IPA.Utilities.ReflectionUtil.GetProperty*"></a>
  373. <h4 id="IPA_Utilities_ReflectionUtil_GetProperty__2___0_System_String_" data-uid="IPA.Utilities.ReflectionUtil.GetProperty``2(``0,System.String)">GetProperty&lt;T, U&gt;(T, String)</h4>
  374. <div class="markdown level1 summary"><p>Gets a property on the target object, as gotten from <code data-dev-comment-type="typeparamref" class="typeparamref">T</code>.</p>
  375. </div>
  376. <div class="markdown level1 conceptual"></div>
  377. <h5 class="decalaration">Declaration</h5>
  378. <div class="codewrapper">
  379. <pre><code class="lang-csharp hljs">public static U GetProperty&lt;T, U&gt;(this T obj, string propertyName)</code></pre>
  380. </div>
  381. <h5 class="parameters">Parameters</h5>
  382. <table class="table table-bordered table-striped table-condensed">
  383. <thead>
  384. <tr>
  385. <th>Type</th>
  386. <th>Name</th>
  387. <th>Description</th>
  388. </tr>
  389. </thead>
  390. <tbody>
  391. <tr>
  392. <td><span class="xref">T</span></td>
  393. <td><span class="parametername">obj</span></td>
  394. <td><p>the object instance</p>
  395. </td>
  396. </tr>
  397. <tr>
  398. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  399. <td><span class="parametername">propertyName</span></td>
  400. <td><p>the property to get</p>
  401. </td>
  402. </tr>
  403. </tbody>
  404. </table>
  405. <h5 class="returns">Returns</h5>
  406. <table class="table table-bordered table-striped table-condensed">
  407. <thead>
  408. <tr>
  409. <th>Type</th>
  410. <th>Description</th>
  411. </tr>
  412. </thead>
  413. <tbody>
  414. <tr>
  415. <td><span class="xref">U</span></td>
  416. <td><p>the value of the property</p>
  417. </td>
  418. </tr>
  419. </tbody>
  420. </table>
  421. <h5 class="typeParameters">Type Parameters</h5>
  422. <table class="table table-bordered table-striped table-condensed">
  423. <thead>
  424. <tr>
  425. <th>Name</th>
  426. <th>Description</th>
  427. </tr>
  428. </thead>
  429. <tbody>
  430. <tr>
  431. <td><span class="parametername">T</span></td>
  432. <td><p>the type to get the property from</p>
  433. </td>
  434. </tr>
  435. <tr>
  436. <td><span class="parametername">U</span></td>
  437. <td><p>the type of the property to get</p>
  438. </td>
  439. </tr>
  440. </tbody>
  441. </table>
  442. <h5 class="exceptions">Exceptions</h5>
  443. <table class="table table-bordered table-striped table-condensed">
  444. <thead>
  445. <tr>
  446. <th>Type</th>
  447. <th>Condition</th>
  448. </tr>
  449. </thead>
  450. <tbody>
  451. <tr>
  452. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingmemberexception">MissingMemberException</a></td>
  453. <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>
  454. </td>
  455. </tr>
  456. </tbody>
  457. </table>
  458. <h5 id="IPA_Utilities_ReflectionUtil_GetProperty__2___0_System_String__seealso">See Also</h5>
  459. <div class="seealso">
  460. <div><a class="xref" href="IPA.Utilities.PropertyAccessor-2.html#IPA_Utilities_PropertyAccessor_2_Get__0__System_String_">Get(ref T, String)</a></div>
  461. </div>
  462. <span class="small pull-right mobile-hide">
  463. <span class="divider">|</span>
  464. <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>
  465. </span>
  466. <span class="small pull-right mobile-hide">
  467. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L77">View Source</a>
  468. </span>
  469. <a id="IPA_Utilities_ReflectionUtil_InvokeMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod*"></a>
  470. <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>
  471. <div class="markdown level1 summary"><p>Invokes a method from <code data-dev-comment-type="typeparamref" class="typeparamref">T</code> on an object.</p>
  472. </div>
  473. <div class="markdown level1 conceptual"></div>
  474. <h5 class="decalaration">Declaration</h5>
  475. <div class="codewrapper">
  476. <pre><code class="lang-csharp hljs">public static object InvokeMethod&lt;T&gt;(this T obj, string methodName, params object[] args)</code></pre>
  477. </div>
  478. <h5 class="parameters">Parameters</h5>
  479. <table class="table table-bordered table-striped table-condensed">
  480. <thead>
  481. <tr>
  482. <th>Type</th>
  483. <th>Name</th>
  484. <th>Description</th>
  485. </tr>
  486. </thead>
  487. <tbody>
  488. <tr>
  489. <td><span class="xref">T</span></td>
  490. <td><span class="parametername">obj</span></td>
  491. <td><p>the object instance</p>
  492. </td>
  493. </tr>
  494. <tr>
  495. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  496. <td><span class="parametername">methodName</span></td>
  497. <td><p>the method&apos;s name</p>
  498. </td>
  499. </tr>
  500. <tr>
  501. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>[]</td>
  502. <td><span class="parametername">args</span></td>
  503. <td><p>the method arguments</p>
  504. </td>
  505. </tr>
  506. </tbody>
  507. </table>
  508. <h5 class="returns">Returns</h5>
  509. <table class="table table-bordered table-striped table-condensed">
  510. <thead>
  511. <tr>
  512. <th>Type</th>
  513. <th>Description</th>
  514. </tr>
  515. </thead>
  516. <tbody>
  517. <tr>
  518. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  519. <td><p>the return value</p>
  520. </td>
  521. </tr>
  522. </tbody>
  523. </table>
  524. <h5 class="typeParameters">Type Parameters</h5>
  525. <table class="table table-bordered table-striped table-condensed">
  526. <thead>
  527. <tr>
  528. <th>Name</th>
  529. <th>Description</th>
  530. </tr>
  531. </thead>
  532. <tbody>
  533. <tr>
  534. <td><span class="parametername">T</span></td>
  535. <td><p>the type to search for the method on</p>
  536. </td>
  537. </tr>
  538. </tbody>
  539. </table>
  540. <h5 class="exceptions">Exceptions</h5>
  541. <table class="table table-bordered table-striped table-condensed">
  542. <thead>
  543. <tr>
  544. <th>Type</th>
  545. <th>Condition</th>
  546. </tr>
  547. </thead>
  548. <tbody>
  549. <tr>
  550. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  551. <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>
  552. </td>
  553. </tr>
  554. </tbody>
  555. </table>
  556. <span class="small pull-right mobile-hide">
  557. <span class="divider">|</span>
  558. <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>
  559. </span>
  560. <span class="small pull-right mobile-hide">
  561. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L95">View Source</a>
  562. </span>
  563. <a id="IPA_Utilities_ReflectionUtil_InvokeMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod*"></a>
  564. <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>
  565. <div class="markdown level1 summary"><p>Invokes a method from <code data-dev-comment-type="typeparamref" class="typeparamref">U</code> on an object.</p>
  566. </div>
  567. <div class="markdown level1 conceptual"></div>
  568. <h5 class="decalaration">Declaration</h5>
  569. <div class="codewrapper">
  570. <pre><code class="lang-csharp hljs">public static T InvokeMethod&lt;T, U&gt;(this U obj, string methodName, params object[] methodArgs)</code></pre>
  571. </div>
  572. <h5 class="parameters">Parameters</h5>
  573. <table class="table table-bordered table-striped table-condensed">
  574. <thead>
  575. <tr>
  576. <th>Type</th>
  577. <th>Name</th>
  578. <th>Description</th>
  579. </tr>
  580. </thead>
  581. <tbody>
  582. <tr>
  583. <td><span class="xref">U</span></td>
  584. <td><span class="parametername">obj</span></td>
  585. <td><p>the object instance</p>
  586. </td>
  587. </tr>
  588. <tr>
  589. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  590. <td><span class="parametername">methodName</span></td>
  591. <td><p>the method name to call</p>
  592. </td>
  593. </tr>
  594. <tr>
  595. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>[]</td>
  596. <td><span class="parametername">methodArgs</span></td>
  597. <td><p>the method&apos;s arguments</p>
  598. </td>
  599. </tr>
  600. </tbody>
  601. </table>
  602. <h5 class="returns">Returns</h5>
  603. <table class="table table-bordered table-striped table-condensed">
  604. <thead>
  605. <tr>
  606. <th>Type</th>
  607. <th>Description</th>
  608. </tr>
  609. </thead>
  610. <tbody>
  611. <tr>
  612. <td><span class="xref">T</span></td>
  613. <td><p>the return value</p>
  614. </td>
  615. </tr>
  616. </tbody>
  617. </table>
  618. <h5 class="typeParameters">Type Parameters</h5>
  619. <table class="table table-bordered table-striped table-condensed">
  620. <thead>
  621. <tr>
  622. <th>Name</th>
  623. <th>Description</th>
  624. </tr>
  625. </thead>
  626. <tbody>
  627. <tr>
  628. <td><span class="parametername">T</span></td>
  629. <td><p>the return type</p>
  630. </td>
  631. </tr>
  632. <tr>
  633. <td><span class="parametername">U</span></td>
  634. <td><p>the type to search for the method on</p>
  635. </td>
  636. </tr>
  637. </tbody>
  638. </table>
  639. <h5 class="exceptions">Exceptions</h5>
  640. <table class="table table-bordered table-striped table-condensed">
  641. <thead>
  642. <tr>
  643. <th>Type</th>
  644. <th>Condition</th>
  645. </tr>
  646. </thead>
  647. <tbody>
  648. <tr>
  649. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
  650. <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>
  651. </td>
  652. </tr>
  653. </tbody>
  654. </table>
  655. <h5 id="IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object____seealso">See Also</h5>
  656. <div class="seealso">
  657. <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>
  658. </div>
  659. <span class="small pull-right mobile-hide">
  660. <span class="divider">|</span>
  661. <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__2___0_System_String___1_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetField%60%602(%60%600%2CSystem.String%2C%60%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  662. </span>
  663. <span class="small pull-right mobile-hide">
  664. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L26">View Source</a>
  665. </span>
  666. <a id="IPA_Utilities_ReflectionUtil_SetField_" data-uid="IPA.Utilities.ReflectionUtil.SetField*"></a>
  667. <h4 id="IPA_Utilities_ReflectionUtil_SetField__2___0_System_String___1_" data-uid="IPA.Utilities.ReflectionUtil.SetField``2(``0,System.String,``1)">SetField&lt;T, U&gt;(T, String, U)</h4>
  668. <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>
  669. </div>
  670. <div class="markdown level1 conceptual"></div>
  671. <h5 class="decalaration">Declaration</h5>
  672. <div class="codewrapper">
  673. <pre><code class="lang-csharp hljs">public static void SetField&lt;T, U&gt;(this T obj, string fieldName, U value)</code></pre>
  674. </div>
  675. <h5 class="parameters">Parameters</h5>
  676. <table class="table table-bordered table-striped table-condensed">
  677. <thead>
  678. <tr>
  679. <th>Type</th>
  680. <th>Name</th>
  681. <th>Description</th>
  682. </tr>
  683. </thead>
  684. <tbody>
  685. <tr>
  686. <td><span class="xref">T</span></td>
  687. <td><span class="parametername">obj</span></td>
  688. <td><p>the object instance</p>
  689. </td>
  690. </tr>
  691. <tr>
  692. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  693. <td><span class="parametername">fieldName</span></td>
  694. <td><p>the field to set</p>
  695. </td>
  696. </tr>
  697. <tr>
  698. <td><span class="xref">U</span></td>
  699. <td><span class="parametername">value</span></td>
  700. <td><p>the value to set it to</p>
  701. </td>
  702. </tr>
  703. </tbody>
  704. </table>
  705. <h5 class="typeParameters">Type Parameters</h5>
  706. <table class="table table-bordered table-striped table-condensed">
  707. <thead>
  708. <tr>
  709. <th>Name</th>
  710. <th>Description</th>
  711. </tr>
  712. </thead>
  713. <tbody>
  714. <tr>
  715. <td><span class="parametername">T</span></td>
  716. <td><p>the type to get the field from</p>
  717. </td>
  718. </tr>
  719. <tr>
  720. <td><span class="parametername">U</span></td>
  721. <td><p>the type of the field to set</p>
  722. </td>
  723. </tr>
  724. </tbody>
  725. </table>
  726. <h5 class="exceptions">Exceptions</h5>
  727. <table class="table table-bordered table-striped table-condensed">
  728. <thead>
  729. <tr>
  730. <th>Type</th>
  731. <th>Condition</th>
  732. </tr>
  733. </thead>
  734. <tbody>
  735. <tr>
  736. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  737. <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>
  738. </td>
  739. </tr>
  740. </tbody>
  741. </table>
  742. <h5 id="IPA_Utilities_ReflectionUtil_SetField__2___0_System_String___1__seealso">See Also</h5>
  743. <div class="seealso">
  744. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Set__0__System_String__1_">Set(ref T, String, U)</a></div>
  745. </div>
  746. <span class="small pull-right mobile-hide">
  747. <span class="divider">|</span>
  748. <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__2___0_System_String___1_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetProperty%60%602(%60%600%2CSystem.String%2C%60%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  749. </span>
  750. <span class="small pull-right mobile-hide">
  751. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L52">View Source</a>
  752. </span>
  753. <a id="IPA_Utilities_ReflectionUtil_SetProperty_" data-uid="IPA.Utilities.ReflectionUtil.SetProperty*"></a>
  754. <h4 id="IPA_Utilities_ReflectionUtil_SetProperty__2___0_System_String___1_" data-uid="IPA.Utilities.ReflectionUtil.SetProperty``2(``0,System.String,``1)">SetProperty&lt;T, U&gt;(T, String, U)</h4>
  755. <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>
  756. </div>
  757. <div class="markdown level1 conceptual"></div>
  758. <h5 class="decalaration">Declaration</h5>
  759. <div class="codewrapper">
  760. <pre><code class="lang-csharp hljs">public static void SetProperty&lt;T, U&gt;(this T obj, string propertyName, U value)</code></pre>
  761. </div>
  762. <h5 class="parameters">Parameters</h5>
  763. <table class="table table-bordered table-striped table-condensed">
  764. <thead>
  765. <tr>
  766. <th>Type</th>
  767. <th>Name</th>
  768. <th>Description</th>
  769. </tr>
  770. </thead>
  771. <tbody>
  772. <tr>
  773. <td><span class="xref">T</span></td>
  774. <td><span class="parametername">obj</span></td>
  775. <td><p>the object instance</p>
  776. </td>
  777. </tr>
  778. <tr>
  779. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  780. <td><span class="parametername">propertyName</span></td>
  781. <td><p>the property to set</p>
  782. </td>
  783. </tr>
  784. <tr>
  785. <td><span class="xref">U</span></td>
  786. <td><span class="parametername">value</span></td>
  787. <td><p>the value to set it to</p>
  788. </td>
  789. </tr>
  790. </tbody>
  791. </table>
  792. <h5 class="typeParameters">Type Parameters</h5>
  793. <table class="table table-bordered table-striped table-condensed">
  794. <thead>
  795. <tr>
  796. <th>Name</th>
  797. <th>Description</th>
  798. </tr>
  799. </thead>
  800. <tbody>
  801. <tr>
  802. <td><span class="parametername">T</span></td>
  803. <td><p>the type to get the property from</p>
  804. </td>
  805. </tr>
  806. <tr>
  807. <td><span class="parametername">U</span></td>
  808. <td><p>the type of the property to set</p>
  809. </td>
  810. </tr>
  811. </tbody>
  812. </table>
  813. <h5 class="exceptions">Exceptions</h5>
  814. <table class="table table-bordered table-striped table-condensed">
  815. <thead>
  816. <tr>
  817. <th>Type</th>
  818. <th>Condition</th>
  819. </tr>
  820. </thead>
  821. <tbody>
  822. <tr>
  823. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingmemberexception">MissingMemberException</a></td>
  824. <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>
  825. </td>
  826. </tr>
  827. </tbody>
  828. </table>
  829. <h5 id="IPA_Utilities_ReflectionUtil_SetProperty__2___0_System_String___1__seealso">See Also</h5>
  830. <div class="seealso">
  831. <div><a class="xref" href="IPA.Utilities.PropertyAccessor-2.html#IPA_Utilities_PropertyAccessor_2_Set__0__System_String__1_">Set(ref T, String, U)</a></div>
  832. </div>
  833. </article>
  834. </div>
  835. <div class="hidden-sm col-md-2" role="complementary">
  836. <div class="sideaffix">
  837. <div class="contribution">
  838. <ul class="nav">
  839. <li>
  840. <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>
  841. </li>
  842. <li>
  843. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/8624d4e78a0a5e0e686d761e7264c200ffd4e0e7/IPA.Loader/Utilities/ReflectionUtil.cs/#L11" class="contribution-link">View Source</a>
  844. </li>
  845. </ul>
  846. </div>
  847. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  848. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  849. </nav>
  850. </div>
  851. </div>
  852. </div>
  853. </div>
  854. <footer>
  855. <div class="grad-bottom"></div>
  856. <div class="footer">
  857. <div class="container">
  858. <span class="pull-right">
  859. <a href="#top">Back to top</a>
  860. </span>
  861. <span>Generated by <strong>DocFX</strong></span>
  862. </div>
  863. </div>
  864. </footer>
  865. </div>
  866. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  867. <script type="text/javascript" src="../styles/docfx.js"></script>
  868. <script type="text/javascript" src="../styles/main.js"></script>
  869. </body>
  870. </html>