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.

846 lines
37 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.42.4.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
  18. <meta property="docfx:navrel" content="../toc.html">
  19. <meta property="docfx:tocrel" content="toc.html">
  20. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  21. <div id="wrapper">
  22. <header>
  23. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  24. <div class="container">
  25. <div class="navbar-header">
  26. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  27. <span class="sr-only">Toggle navigation</span>
  28. <span class="icon-bar"></span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. </button>
  32. <a class="navbar-brand" href="../index.html">
  33. <img id="logo" class="svg" src="../logo.svg" alt="">
  34. </a>
  35. </div>
  36. <div class="collapse navbar-collapse" id="navbar">
  37. <form class="navbar-form navbar-right" role="search" id="search">
  38. <div class="form-group">
  39. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </nav>
  45. <div class="subnav navbar navbar-default">
  46. <div class="container hide-when-search" id="breadcrumb">
  47. <ul class="breadcrumb">
  48. <li></li>
  49. </ul>
  50. </div>
  51. </div>
  52. </header>
  53. <div role="main" class="container body-content hide-when-search">
  54. <div class="sidenav hide-when-search">
  55. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  56. <div class="sidetoggle collapse" id="sidetoggle">
  57. <div id="sidetoc"></div>
  58. </div>
  59. </div>
  60. <div class="article row grid-right">
  61. <div class="col-md-10">
  62. <article class="content wrap" id="_content" data-uid="IPA.Utilities.ReflectionUtil">
  63. <h1 id="IPA_Utilities_ReflectionUtil" data-uid="IPA.Utilities.ReflectionUtil" class="text-break">Class ReflectionUtil
  64. </h1>
  65. <div class="markdown level0 summary"><p>A utility class providing reflection helper methods.</p>
  66. </div>
  67. <div class="markdown level0 conceptual"></div>
  68. <div class="inheritance">
  69. <h5>Inheritance</h5>
  70. <div class="level0"><span class="xref">System.Object</span></div>
  71. <div class="level1"><span class="xref">ReflectionUtil</span></div>
  72. </div>
  73. <div class="inheritedMembers">
  74. <h5>Inherited Members</h5>
  75. <div>
  76. <span class="xref">System.Object.ToString()</span>
  77. </div>
  78. <div>
  79. <span class="xref">System.Object.Equals(System.Object)</span>
  80. </div>
  81. <div>
  82. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  83. </div>
  84. <div>
  85. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  86. </div>
  87. <div>
  88. <span class="xref">System.Object.GetHashCode()</span>
  89. </div>
  90. <div>
  91. <span class="xref">System.Object.GetType()</span>
  92. </div>
  93. <div>
  94. <span class="xref">System.Object.MemberwiseClone()</span>
  95. </div>
  96. </div>
  97. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.html">IPA.Utilities</a></h6>
  98. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  99. <h5 id="IPA_Utilities_ReflectionUtil_syntax">Syntax</h5>
  100. <div class="codewrapper">
  101. <pre><code class="lang-csharp hljs">public static class ReflectionUtil</code></pre>
  102. </div>
  103. <h3 id="methods">Methods
  104. </h3>
  105. <span class="small pull-right mobile-hide">
  106. <span class="divider">|</span>
  107. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_CallNonStaticMethod_System_String_System_String_System_String_System_Type___System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.CallNonStaticMethod(System.String%2CSystem.String%2CSystem.String%2CSystem.Type%5B%5D%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>
  108. </span>
  109. <span class="small pull-right mobile-hide">
  110. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L145">View Source</a>
  111. </span>
  112. <a id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod_" data-uid="IPA.Utilities.ReflectionUtil.CallNonStaticMethod*"></a>
  113. <h4 id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod_System_String_System_String_System_String_System_Type___System_Object___" data-uid="IPA.Utilities.ReflectionUtil.CallNonStaticMethod(System.String,System.String,System.String,System.Type[],System.Object[])">CallNonStaticMethod(String, String, String, Type[], Object[])</h4>
  114. <div class="markdown level1 summary"><p>Calls an instance method on a type specified by <code data-dev-comment-type="paramref" class="paramref">functionClass</code> and <code data-dev-comment-type="paramref" class="paramref">dependency</code>.</p>
  115. </div>
  116. <div class="markdown level1 conceptual"></div>
  117. <h5 class="decalaration">Declaration</h5>
  118. <div class="codewrapper">
  119. <pre><code class="lang-csharp hljs">public static object CallNonStaticMethod(string functionClass, string dependency, string function, Type[] methodSig, params object[] parameters)</code></pre>
  120. </div>
  121. <h5 class="parameters">Parameters</h5>
  122. <table class="table table-bordered table-striped table-condensed">
  123. <thead>
  124. <tr>
  125. <th>Type</th>
  126. <th>Name</th>
  127. <th>Description</th>
  128. </tr>
  129. </thead>
  130. <tbody>
  131. <tr>
  132. <td><span class="xref">System.String</span></td>
  133. <td><span class="parametername">functionClass</span></td>
  134. <td><p>the type name</p>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td><span class="xref">System.String</span></td>
  139. <td><span class="parametername">dependency</span></td>
  140. <td><p>the assembly the type is in</p>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td><span class="xref">System.String</span></td>
  145. <td><span class="parametername">function</span></td>
  146. <td><p>the name of the method to call</p>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td><span class="xref">System.Type</span>[]</td>
  151. <td><span class="parametername">methodSig</span></td>
  152. <td><p>the type signature of the method</p>
  153. </td>
  154. </tr>
  155. <tr>
  156. <td><span class="xref">System.Object</span>[]</td>
  157. <td><span class="parametername">parameters</span></td>
  158. <td><p>the method parameters</p>
  159. </td>
  160. </tr>
  161. </tbody>
  162. </table>
  163. <h5 class="returns">Returns</h5>
  164. <table class="table table-bordered table-striped table-condensed">
  165. <thead>
  166. <tr>
  167. <th>Type</th>
  168. <th>Description</th>
  169. </tr>
  170. </thead>
  171. <tbody>
  172. <tr>
  173. <td><span class="xref">System.Object</span></td>
  174. <td><p>the result of the call</p>
  175. </td>
  176. </tr>
  177. </tbody>
  178. </table>
  179. <h5 id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod_System_String_System_String_System_String_System_Type___System_Object____seealso">See Also</h5>
  180. <div class="seealso">
  181. <div><a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_CallNonStaticMethod_System_Type_System_String_System_Type___System_Object___">CallNonStaticMethod(Type, String, Type[], Object[])</a></div>
  182. </div>
  183. <span class="small pull-right mobile-hide">
  184. <span class="divider">|</span>
  185. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_CallNonStaticMethod_System_Type_System_String_System_Type___System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.CallNonStaticMethod(System.Type%2CSystem.String%2CSystem.Type%5B%5D%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>
  186. </span>
  187. <span class="small pull-right mobile-hide">
  188. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L158">View Source</a>
  189. </span>
  190. <a id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod_" data-uid="IPA.Utilities.ReflectionUtil.CallNonStaticMethod*"></a>
  191. <h4 id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod_System_Type_System_String_System_Type___System_Object___" data-uid="IPA.Utilities.ReflectionUtil.CallNonStaticMethod(System.Type,System.String,System.Type[],System.Object[])">CallNonStaticMethod(Type, String, Type[], Object[])</h4>
  192. <div class="markdown level1 summary"><p>Calls an instance method on a new object.</p>
  193. </div>
  194. <div class="markdown level1 conceptual"></div>
  195. <h5 class="decalaration">Declaration</h5>
  196. <div class="codewrapper">
  197. <pre><code class="lang-csharp hljs">public static object CallNonStaticMethod(this Type type, string function, Type[] methodSig, params object[] parameters)</code></pre>
  198. </div>
  199. <h5 class="parameters">Parameters</h5>
  200. <table class="table table-bordered table-striped table-condensed">
  201. <thead>
  202. <tr>
  203. <th>Type</th>
  204. <th>Name</th>
  205. <th>Description</th>
  206. </tr>
  207. </thead>
  208. <tbody>
  209. <tr>
  210. <td><span class="xref">System.Type</span></td>
  211. <td><span class="parametername">type</span></td>
  212. <td><p>the object type</p>
  213. </td>
  214. </tr>
  215. <tr>
  216. <td><span class="xref">System.String</span></td>
  217. <td><span class="parametername">function</span></td>
  218. <td><p>the name of the method to call</p>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td><span class="xref">System.Type</span>[]</td>
  223. <td><span class="parametername">methodSig</span></td>
  224. <td><p>the type signature</p>
  225. </td>
  226. </tr>
  227. <tr>
  228. <td><span class="xref">System.Object</span>[]</td>
  229. <td><span class="parametername">parameters</span></td>
  230. <td><p>the parameters</p>
  231. </td>
  232. </tr>
  233. </tbody>
  234. </table>
  235. <h5 class="returns">Returns</h5>
  236. <table class="table table-bordered table-striped table-condensed">
  237. <thead>
  238. <tr>
  239. <th>Type</th>
  240. <th>Description</th>
  241. </tr>
  242. </thead>
  243. <tbody>
  244. <tr>
  245. <td><span class="xref">System.Object</span></td>
  246. <td><p>the result of the call</p>
  247. </td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. <span class="small pull-right mobile-hide">
  252. <span class="divider">|</span>
  253. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_CallNonStaticMethod__1_System_Type_System_String_System_Type___System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.CallNonStaticMethod%60%601(System.Type%2CSystem.String%2CSystem.Type%5B%5D%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>
  254. </span>
  255. <span class="small pull-right mobile-hide">
  256. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L189">View Source</a>
  257. </span>
  258. <a id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod_" data-uid="IPA.Utilities.ReflectionUtil.CallNonStaticMethod*"></a>
  259. <h4 id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod__1_System_Type_System_String_System_Type___System_Object___" data-uid="IPA.Utilities.ReflectionUtil.CallNonStaticMethod``1(System.Type,System.String,System.Type[],System.Object[])">CallNonStaticMethod&lt;T&gt;(Type, String, Type[], Object[])</h4>
  260. <div class="markdown level1 summary"><p>Calls an instance method on a new object.</p>
  261. </div>
  262. <div class="markdown level1 conceptual"></div>
  263. <h5 class="decalaration">Declaration</h5>
  264. <div class="codewrapper">
  265. <pre><code class="lang-csharp hljs">public static T CallNonStaticMethod&lt;T&gt;(this Type type, string function, Type[] methodSig, params object[] parameters)</code></pre>
  266. </div>
  267. <h5 class="parameters">Parameters</h5>
  268. <table class="table table-bordered table-striped table-condensed">
  269. <thead>
  270. <tr>
  271. <th>Type</th>
  272. <th>Name</th>
  273. <th>Description</th>
  274. </tr>
  275. </thead>
  276. <tbody>
  277. <tr>
  278. <td><span class="xref">System.Type</span></td>
  279. <td><span class="parametername">type</span></td>
  280. <td><p>the object type</p>
  281. </td>
  282. </tr>
  283. <tr>
  284. <td><span class="xref">System.String</span></td>
  285. <td><span class="parametername">function</span></td>
  286. <td><p>the name of the method to call</p>
  287. </td>
  288. </tr>
  289. <tr>
  290. <td><span class="xref">System.Type</span>[]</td>
  291. <td><span class="parametername">methodSig</span></td>
  292. <td><p>the type signature</p>
  293. </td>
  294. </tr>
  295. <tr>
  296. <td><span class="xref">System.Object</span>[]</td>
  297. <td><span class="parametername">parameters</span></td>
  298. <td><p>the parameters</p>
  299. </td>
  300. </tr>
  301. </tbody>
  302. </table>
  303. <h5 class="returns">Returns</h5>
  304. <table class="table table-bordered table-striped table-condensed">
  305. <thead>
  306. <tr>
  307. <th>Type</th>
  308. <th>Description</th>
  309. </tr>
  310. </thead>
  311. <tbody>
  312. <tr>
  313. <td><span class="xref">T</span></td>
  314. <td><p>the result of the call</p>
  315. </td>
  316. </tr>
  317. </tbody>
  318. </table>
  319. <h5 class="typeParameters">Type Parameters</h5>
  320. <table class="table table-bordered table-striped table-condensed">
  321. <thead>
  322. <tr>
  323. <th>Name</th>
  324. <th>Description</th>
  325. </tr>
  326. </thead>
  327. <tbody>
  328. <tr>
  329. <td><span class="parametername">T</span></td>
  330. <td><p>the return type</p>
  331. </td>
  332. </tr>
  333. </tbody>
  334. </table>
  335. <h5 id="IPA_Utilities_ReflectionUtil_CallNonStaticMethod__1_System_Type_System_String_System_Type___System_Object____seealso">See Also</h5>
  336. <div class="seealso">
  337. <div><a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_CallNonStaticMethod_System_Type_System_String_System_Type___System_Object___">CallNonStaticMethod(Type, String, Type[], Object[])</a></div>
  338. </div>
  339. <span class="small pull-right mobile-hide">
  340. <span class="divider">|</span>
  341. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/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>
  342. </span>
  343. <span class="small pull-right mobile-hide">
  344. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L85">View Source</a>
  345. </span>
  346. <a id="IPA_Utilities_ReflectionUtil_CopyComponent_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent*"></a>
  347. <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>
  348. <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>
  349. </div>
  350. <div class="markdown level1 conceptual"></div>
  351. <h5 class="decalaration">Declaration</h5>
  352. <div class="codewrapper">
  353. <pre><code class="lang-csharp hljs">public static Component CopyComponent(this Component original, Type overridingType, GameObject destination, Type originalTypeOverride = null)</code></pre>
  354. </div>
  355. <h5 class="parameters">Parameters</h5>
  356. <table class="table table-bordered table-striped table-condensed">
  357. <thead>
  358. <tr>
  359. <th>Type</th>
  360. <th>Name</th>
  361. <th>Description</th>
  362. </tr>
  363. </thead>
  364. <tbody>
  365. <tr>
  366. <td><span class="xref">UnityEngine.Component</span></td>
  367. <td><span class="parametername">original</span></td>
  368. <td><p>the original component</p>
  369. </td>
  370. </tr>
  371. <tr>
  372. <td><span class="xref">System.Type</span></td>
  373. <td><span class="parametername">overridingType</span></td>
  374. <td><p>the new component's type</p>
  375. </td>
  376. </tr>
  377. <tr>
  378. <td><span class="xref">UnityEngine.GameObject</span></td>
  379. <td><span class="parametername">destination</span></td>
  380. <td><p>the destination GameObject</p>
  381. </td>
  382. </tr>
  383. <tr>
  384. <td><span class="xref">System.Type</span></td>
  385. <td><span class="parametername">originalTypeOverride</span></td>
  386. <td><p>overrides the source component type (for example, to a superclass)</p>
  387. </td>
  388. </tr>
  389. </tbody>
  390. </table>
  391. <h5 class="returns">Returns</h5>
  392. <table class="table table-bordered table-striped table-condensed">
  393. <thead>
  394. <tr>
  395. <th>Type</th>
  396. <th>Description</th>
  397. </tr>
  398. </thead>
  399. <tbody>
  400. <tr>
  401. <td><span class="xref">UnityEngine.Component</span></td>
  402. <td><p>the copied component</p>
  403. </td>
  404. </tr>
  405. </tbody>
  406. </table>
  407. <span class="small pull-right mobile-hide">
  408. <span class="divider">|</span>
  409. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/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>
  410. </span>
  411. <span class="small pull-right mobile-hide">
  412. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L109">View Source</a>
  413. </span>
  414. <a id="IPA_Utilities_ReflectionUtil_CopyComponent_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent*"></a>
  415. <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>
  416. <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>
  417. </div>
  418. <div class="markdown level1 conceptual"></div>
  419. <h5 class="decalaration">Declaration</h5>
  420. <div class="codewrapper">
  421. <pre><code class="lang-csharp hljs">public static T CopyComponent&lt;T&gt;(this Component original, GameObject destination, Type originalTypeOverride = null)
  422. where T : Component</code></pre>
  423. </div>
  424. <h5 class="parameters">Parameters</h5>
  425. <table class="table table-bordered table-striped table-condensed">
  426. <thead>
  427. <tr>
  428. <th>Type</th>
  429. <th>Name</th>
  430. <th>Description</th>
  431. </tr>
  432. </thead>
  433. <tbody>
  434. <tr>
  435. <td><span class="xref">UnityEngine.Component</span></td>
  436. <td><span class="parametername">original</span></td>
  437. <td><p>the original component</p>
  438. </td>
  439. </tr>
  440. <tr>
  441. <td><span class="xref">UnityEngine.GameObject</span></td>
  442. <td><span class="parametername">destination</span></td>
  443. <td><p>the destination game object</p>
  444. </td>
  445. </tr>
  446. <tr>
  447. <td><span class="xref">System.Type</span></td>
  448. <td><span class="parametername">originalTypeOverride</span></td>
  449. <td><p>overrides the source component type (for example, to a superclass)</p>
  450. </td>
  451. </tr>
  452. </tbody>
  453. </table>
  454. <h5 class="returns">Returns</h5>
  455. <table class="table table-bordered table-striped table-condensed">
  456. <thead>
  457. <tr>
  458. <th>Type</th>
  459. <th>Description</th>
  460. </tr>
  461. </thead>
  462. <tbody>
  463. <tr>
  464. <td><span class="xref">T</span></td>
  465. <td><p>the copied component</p>
  466. </td>
  467. </tr>
  468. </tbody>
  469. </table>
  470. <h5 class="typeParameters">Type Parameters</h5>
  471. <table class="table table-bordered table-striped table-condensed">
  472. <thead>
  473. <tr>
  474. <th>Name</th>
  475. <th>Description</th>
  476. </tr>
  477. </thead>
  478. <tbody>
  479. <tr>
  480. <td><span class="parametername">T</span></td>
  481. <td><p>the overriding type</p>
  482. </td>
  483. </tr>
  484. </tbody>
  485. </table>
  486. <h5 id="IPA_Utilities_ReflectionUtil_CopyComponent__1_UnityEngine_Component_UnityEngine_GameObject_System_Type__seealso">See Also</h5>
  487. <div class="seealso">
  488. <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>
  489. </div>
  490. <span class="small pull-right mobile-hide">
  491. <span class="divider">|</span>
  492. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_GetPrivateField__1_System_Object_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.GetPrivateField%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>
  493. </span>
  494. <span class="small pull-right mobile-hide">
  495. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L31">View Source</a>
  496. </span>
  497. <a id="IPA_Utilities_ReflectionUtil_GetPrivateField_" data-uid="IPA.Utilities.ReflectionUtil.GetPrivateField*"></a>
  498. <h4 id="IPA_Utilities_ReflectionUtil_GetPrivateField__1_System_Object_System_String_" data-uid="IPA.Utilities.ReflectionUtil.GetPrivateField``1(System.Object,System.String)">GetPrivateField&lt;T&gt;(Object, String)</h4>
  499. <div class="markdown level1 summary"><p>Gets the value of a (potentially) private field.</p>
  500. </div>
  501. <div class="markdown level1 conceptual"></div>
  502. <h5 class="decalaration">Declaration</h5>
  503. <div class="codewrapper">
  504. <pre><code class="lang-csharp hljs">public static T GetPrivateField&lt;T&gt;(this object obj, string fieldName)</code></pre>
  505. </div>
  506. <h5 class="parameters">Parameters</h5>
  507. <table class="table table-bordered table-striped table-condensed">
  508. <thead>
  509. <tr>
  510. <th>Type</th>
  511. <th>Name</th>
  512. <th>Description</th>
  513. </tr>
  514. </thead>
  515. <tbody>
  516. <tr>
  517. <td><span class="xref">System.Object</span></td>
  518. <td><span class="parametername">obj</span></td>
  519. <td><p>the object instance to pull from</p>
  520. </td>
  521. </tr>
  522. <tr>
  523. <td><span class="xref">System.String</span></td>
  524. <td><span class="parametername">fieldName</span></td>
  525. <td><p>the name of the field to read</p>
  526. </td>
  527. </tr>
  528. </tbody>
  529. </table>
  530. <h5 class="returns">Returns</h5>
  531. <table class="table table-bordered table-striped table-condensed">
  532. <thead>
  533. <tr>
  534. <th>Type</th>
  535. <th>Description</th>
  536. </tr>
  537. </thead>
  538. <tbody>
  539. <tr>
  540. <td><span class="xref">T</span></td>
  541. <td><p>the value of the field</p>
  542. </td>
  543. </tr>
  544. </tbody>
  545. </table>
  546. <h5 class="typeParameters">Type Parameters</h5>
  547. <table class="table table-bordered table-striped table-condensed">
  548. <thead>
  549. <tr>
  550. <th>Name</th>
  551. <th>Description</th>
  552. </tr>
  553. </thead>
  554. <tbody>
  555. <tr>
  556. <td><span class="parametername">T</span></td>
  557. <td><p>the type of te field (result casted)</p>
  558. </td>
  559. </tr>
  560. </tbody>
  561. </table>
  562. <span class="small pull-right mobile-hide">
  563. <span class="divider">|</span>
  564. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_InvokePrivateMethod_System_Object_System_String_System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.InvokePrivateMethod(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>
  565. </span>
  566. <span class="small pull-right mobile-hide">
  567. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L58">View Source</a>
  568. </span>
  569. <a id="IPA_Utilities_ReflectionUtil_InvokePrivateMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokePrivateMethod*"></a>
  570. <h4 id="IPA_Utilities_ReflectionUtil_InvokePrivateMethod_System_Object_System_String_System_Object___" data-uid="IPA.Utilities.ReflectionUtil.InvokePrivateMethod(System.Object,System.String,System.Object[])">InvokePrivateMethod(Object, String, Object[])</h4>
  571. <div class="markdown level1 summary"><p>Invokes a (potentially) private method.</p>
  572. </div>
  573. <div class="markdown level1 conceptual"></div>
  574. <h5 class="decalaration">Declaration</h5>
  575. <div class="codewrapper">
  576. <pre><code class="lang-csharp hljs">public static object InvokePrivateMethod(this object obj, string methodName, params object[] methodParams)</code></pre>
  577. </div>
  578. <h5 class="parameters">Parameters</h5>
  579. <table class="table table-bordered table-striped table-condensed">
  580. <thead>
  581. <tr>
  582. <th>Type</th>
  583. <th>Name</th>
  584. <th>Description</th>
  585. </tr>
  586. </thead>
  587. <tbody>
  588. <tr>
  589. <td><span class="xref">System.Object</span></td>
  590. <td><span class="parametername">obj</span></td>
  591. <td><p>the object to call from</p>
  592. </td>
  593. </tr>
  594. <tr>
  595. <td><span class="xref">System.String</span></td>
  596. <td><span class="parametername">methodName</span></td>
  597. <td><p>the method name</p>
  598. </td>
  599. </tr>
  600. <tr>
  601. <td><span class="xref">System.Object</span>[]</td>
  602. <td><span class="parametername">methodParams</span></td>
  603. <td><p>the method parameters</p>
  604. </td>
  605. </tr>
  606. </tbody>
  607. </table>
  608. <h5 class="returns">Returns</h5>
  609. <table class="table table-bordered table-striped table-condensed">
  610. <thead>
  611. <tr>
  612. <th>Type</th>
  613. <th>Description</th>
  614. </tr>
  615. </thead>
  616. <tbody>
  617. <tr>
  618. <td><span class="xref">System.Object</span></td>
  619. <td><p>the return value</p>
  620. </td>
  621. </tr>
  622. </tbody>
  623. </table>
  624. <span class="small pull-right mobile-hide">
  625. <span class="divider">|</span>
  626. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_InvokePrivateMethod__1_System_Object_System_String_System_Object___.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.InvokePrivateMethod%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>
  627. </span>
  628. <span class="small pull-right mobile-hide">
  629. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L72">View Source</a>
  630. </span>
  631. <a id="IPA_Utilities_ReflectionUtil_InvokePrivateMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokePrivateMethod*"></a>
  632. <h4 id="IPA_Utilities_ReflectionUtil_InvokePrivateMethod__1_System_Object_System_String_System_Object___" data-uid="IPA.Utilities.ReflectionUtil.InvokePrivateMethod``1(System.Object,System.String,System.Object[])">InvokePrivateMethod&lt;T&gt;(Object, String, Object[])</h4>
  633. <div class="markdown level1 summary"><p>Invokes a (potentially) private method.</p>
  634. </div>
  635. <div class="markdown level1 conceptual"></div>
  636. <h5 class="decalaration">Declaration</h5>
  637. <div class="codewrapper">
  638. <pre><code class="lang-csharp hljs">public static T InvokePrivateMethod&lt;T&gt;(this object obj, string methodName, params object[] methodParams)</code></pre>
  639. </div>
  640. <h5 class="parameters">Parameters</h5>
  641. <table class="table table-bordered table-striped table-condensed">
  642. <thead>
  643. <tr>
  644. <th>Type</th>
  645. <th>Name</th>
  646. <th>Description</th>
  647. </tr>
  648. </thead>
  649. <tbody>
  650. <tr>
  651. <td><span class="xref">System.Object</span></td>
  652. <td><span class="parametername">obj</span></td>
  653. <td><p>the object to call from</p>
  654. </td>
  655. </tr>
  656. <tr>
  657. <td><span class="xref">System.String</span></td>
  658. <td><span class="parametername">methodName</span></td>
  659. <td><p>the method name to call</p>
  660. </td>
  661. </tr>
  662. <tr>
  663. <td><span class="xref">System.Object</span>[]</td>
  664. <td><span class="parametername">methodParams</span></td>
  665. <td><p>the method's parameters</p>
  666. </td>
  667. </tr>
  668. </tbody>
  669. </table>
  670. <h5 class="returns">Returns</h5>
  671. <table class="table table-bordered table-striped table-condensed">
  672. <thead>
  673. <tr>
  674. <th>Type</th>
  675. <th>Description</th>
  676. </tr>
  677. </thead>
  678. <tbody>
  679. <tr>
  680. <td><span class="xref">T</span></td>
  681. <td><p>the return value</p>
  682. </td>
  683. </tr>
  684. </tbody>
  685. </table>
  686. <h5 class="typeParameters">Type Parameters</h5>
  687. <table class="table table-bordered table-striped table-condensed">
  688. <thead>
  689. <tr>
  690. <th>Name</th>
  691. <th>Description</th>
  692. </tr>
  693. </thead>
  694. <tbody>
  695. <tr>
  696. <td><span class="parametername">T</span></td>
  697. <td><p>the return type</p>
  698. </td>
  699. </tr>
  700. </tbody>
  701. </table>
  702. <span class="small pull-right mobile-hide">
  703. <span class="divider">|</span>
  704. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_SetPrivateField_System_Object_System_String_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetPrivateField(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>
  705. </span>
  706. <span class="small pull-right mobile-hide">
  707. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L18">View Source</a>
  708. </span>
  709. <a id="IPA_Utilities_ReflectionUtil_SetPrivateField_" data-uid="IPA.Utilities.ReflectionUtil.SetPrivateField*"></a>
  710. <h4 id="IPA_Utilities_ReflectionUtil_SetPrivateField_System_Object_System_String_System_Object_" data-uid="IPA.Utilities.ReflectionUtil.SetPrivateField(System.Object,System.String,System.Object)">SetPrivateField(Object, String, Object)</h4>
  711. <div class="markdown level1 summary"><p>Sets a (potentially) private field on the target object.</p>
  712. </div>
  713. <div class="markdown level1 conceptual"></div>
  714. <h5 class="decalaration">Declaration</h5>
  715. <div class="codewrapper">
  716. <pre><code class="lang-csharp hljs">public static void SetPrivateField(this object obj, string fieldName, object value)</code></pre>
  717. </div>
  718. <h5 class="parameters">Parameters</h5>
  719. <table class="table table-bordered table-striped table-condensed">
  720. <thead>
  721. <tr>
  722. <th>Type</th>
  723. <th>Name</th>
  724. <th>Description</th>
  725. </tr>
  726. </thead>
  727. <tbody>
  728. <tr>
  729. <td><span class="xref">System.Object</span></td>
  730. <td><span class="parametername">obj</span></td>
  731. <td><p>the object instance</p>
  732. </td>
  733. </tr>
  734. <tr>
  735. <td><span class="xref">System.String</span></td>
  736. <td><span class="parametername">fieldName</span></td>
  737. <td><p>the field to set</p>
  738. </td>
  739. </tr>
  740. <tr>
  741. <td><span class="xref">System.Object</span></td>
  742. <td><span class="parametername">value</span></td>
  743. <td><p>the value to set it to</p>
  744. </td>
  745. </tr>
  746. </tbody>
  747. </table>
  748. <span class="small pull-right mobile-hide">
  749. <span class="divider">|</span>
  750. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/new?filename=IPA_Utilities_ReflectionUtil_SetPrivateProperty_System_Object_System_String_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.SetPrivateProperty(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>
  751. </span>
  752. <span class="small pull-right mobile-hide">
  753. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L44">View Source</a>
  754. </span>
  755. <a id="IPA_Utilities_ReflectionUtil_SetPrivateProperty_" data-uid="IPA.Utilities.ReflectionUtil.SetPrivateProperty*"></a>
  756. <h4 id="IPA_Utilities_ReflectionUtil_SetPrivateProperty_System_Object_System_String_System_Object_" data-uid="IPA.Utilities.ReflectionUtil.SetPrivateProperty(System.Object,System.String,System.Object)">SetPrivateProperty(Object, String, Object)</h4>
  757. <div class="markdown level1 summary"><p>Sets a (potentially) private property on the target object.</p>
  758. </div>
  759. <div class="markdown level1 conceptual"></div>
  760. <h5 class="decalaration">Declaration</h5>
  761. <div class="codewrapper">
  762. <pre><code class="lang-csharp hljs">public static void SetPrivateProperty(this object obj, string propertyName, object value)</code></pre>
  763. </div>
  764. <h5 class="parameters">Parameters</h5>
  765. <table class="table table-bordered table-striped table-condensed">
  766. <thead>
  767. <tr>
  768. <th>Type</th>
  769. <th>Name</th>
  770. <th>Description</th>
  771. </tr>
  772. </thead>
  773. <tbody>
  774. <tr>
  775. <td><span class="xref">System.Object</span></td>
  776. <td><span class="parametername">obj</span></td>
  777. <td><p>the target object instance</p>
  778. </td>
  779. </tr>
  780. <tr>
  781. <td><span class="xref">System.String</span></td>
  782. <td><span class="parametername">propertyName</span></td>
  783. <td><p>the name of the property</p>
  784. </td>
  785. </tr>
  786. <tr>
  787. <td><span class="xref">System.Object</span></td>
  788. <td><span class="parametername">value</span></td>
  789. <td><p>the value to set it to</p>
  790. </td>
  791. </tr>
  792. </tbody>
  793. </table>
  794. </article>
  795. </div>
  796. <div class="hidden-sm col-md-2" role="complementary">
  797. <div class="sideaffix">
  798. <div class="contribution">
  799. <ul class="nav">
  800. <li>
  801. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/apiSpec/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>
  802. </li>
  803. <li>
  804. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/master/IPA.Loader/Utilities/ReflectionUtil.cs/#L10" class="contribution-link">View Source</a>
  805. </li>
  806. </ul>
  807. </div>
  808. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  809. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  810. </nav>
  811. </div>
  812. </div>
  813. </div>
  814. </div>
  815. <footer>
  816. <div class="grad-bottom"></div>
  817. <div class="footer">
  818. <div class="container">
  819. <span class="pull-right">
  820. <a href="#top">Back to top</a>
  821. </span>
  822. <span>Generated by <strong>DocFX</strong></span>
  823. </div>
  824. </div>
  825. </footer>
  826. </div>
  827. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  828. <script type="text/javascript" src="../styles/docfx.js"></script>
  829. <script type="text/javascript" src="../styles/main.js"></script>
  830. </body>
  831. </html>