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.

683 lines
29 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.59.3.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">Search Results for <span></span></div>
  59. <div class="sr-items">
  60. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  61. </div>
  62. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></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. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Utilities.html">IPA.Utilities</a></h6>
  86. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  87. <h5 id="IPA_Utilities_ReflectionUtil_syntax">Syntax</h5>
  88. <div class="codewrapper">
  89. <pre><code class="lang-csharp hljs">public static class ReflectionUtil : object</code></pre>
  90. </div>
  91. <h3 id="methods">Methods
  92. </h3>
  93. <span class="small pull-right mobile-hide">
  94. <span class="divider">|</span>
  95. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_ReflectionUtil_CopyComponent_Component_Type_GameObject_Type_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.CopyComponent(Component%2CType%2CGameObject%2CType)%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>
  96. </span>
  97. <span class="small pull-right mobile-hide">
  98. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L93">View Source</a>
  99. </span>
  100. <a id="IPA_Utilities_ReflectionUtil_CopyComponent_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent*"></a>
  101. <h4 id="IPA_Utilities_ReflectionUtil_CopyComponent_Component_Type_GameObject_Type_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent(Component,Type,GameObject,Type)">CopyComponent(Component, Type, GameObject, Type)</h4>
  102. <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 <see cref="!:GameObject"></see>.</p>
  103. </div>
  104. <div class="markdown level1 conceptual"></div>
  105. <h5 class="decalaration">Declaration</h5>
  106. <div class="codewrapper">
  107. <pre><code class="lang-csharp hljs">public static Component CopyComponent(this Component original, Type overridingType, GameObject destination, Type originalTypeOverride = null)</code></pre>
  108. </div>
  109. <h5 class="parameters">Parameters</h5>
  110. <table class="table table-bordered table-striped table-condensed">
  111. <thead>
  112. <tr>
  113. <th>Type</th>
  114. <th>Name</th>
  115. <th>Description</th>
  116. </tr>
  117. </thead>
  118. <tbody>
  119. <tr>
  120. <td><span class="xref">Component</span></td>
  121. <td><span class="parametername">original</span></td>
  122. <td><p>the original component</p>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td><span class="xref">Type</span></td>
  127. <td><span class="parametername">overridingType</span></td>
  128. <td><p>the new component&apos;s type</p>
  129. </td>
  130. </tr>
  131. <tr>
  132. <td><span class="xref">GameObject</span></td>
  133. <td><span class="parametername">destination</span></td>
  134. <td><p>the destination GameObject</p>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td><span class="xref">Type</span></td>
  139. <td><span class="parametername">originalTypeOverride</span></td>
  140. <td><p>overrides the source component type (for example, to a superclass)</p>
  141. </td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. <h5 class="returns">Returns</h5>
  146. <table class="table table-bordered table-striped table-condensed">
  147. <thead>
  148. <tr>
  149. <th>Type</th>
  150. <th>Description</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. <tr>
  155. <td><span class="xref">Component</span></td>
  156. <td><p>the copied component</p>
  157. </td>
  158. </tr>
  159. </tbody>
  160. </table>
  161. <span class="small pull-right mobile-hide">
  162. <span class="divider">|</span>
  163. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_ReflectionUtil_CopyComponent__1_Component_GameObject_Type_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.CopyComponent%60%601(Component%2CGameObject%2CType)%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>
  164. </span>
  165. <span class="small pull-right mobile-hide">
  166. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L117">View Source</a>
  167. </span>
  168. <a id="IPA_Utilities_ReflectionUtil_CopyComponent_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent*"></a>
  169. <h4 id="IPA_Utilities_ReflectionUtil_CopyComponent__1_Component_GameObject_Type_" data-uid="IPA.Utilities.ReflectionUtil.CopyComponent``1(Component,GameObject,Type)">CopyComponent&lt;T&gt;(Component, GameObject, Type)</h4>
  170. <div class="markdown level1 summary"><p>A generic version of <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_CopyComponent_Component_Type_GameObject_Type_">CopyComponent(Component, Type, GameObject, Type)</a>. </p>
  171. </div>
  172. <div class="markdown level1 conceptual"></div>
  173. <h5 class="decalaration">Declaration</h5>
  174. <div class="codewrapper">
  175. <pre><code class="lang-csharp hljs">public static T CopyComponent&lt;T&gt;(this Component original, GameObject destination, Type originalTypeOverride = null)
  176. where T : Component</code></pre>
  177. </div>
  178. <h5 class="parameters">Parameters</h5>
  179. <table class="table table-bordered table-striped table-condensed">
  180. <thead>
  181. <tr>
  182. <th>Type</th>
  183. <th>Name</th>
  184. <th>Description</th>
  185. </tr>
  186. </thead>
  187. <tbody>
  188. <tr>
  189. <td><span class="xref">Component</span></td>
  190. <td><span class="parametername">original</span></td>
  191. <td><p>the original component</p>
  192. </td>
  193. </tr>
  194. <tr>
  195. <td><span class="xref">GameObject</span></td>
  196. <td><span class="parametername">destination</span></td>
  197. <td><p>the destination game object</p>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td><span class="xref">Type</span></td>
  202. <td><span class="parametername">originalTypeOverride</span></td>
  203. <td><p>overrides the source component type (for example, to a superclass)</p>
  204. </td>
  205. </tr>
  206. </tbody>
  207. </table>
  208. <h5 class="returns">Returns</h5>
  209. <table class="table table-bordered table-striped table-condensed">
  210. <thead>
  211. <tr>
  212. <th>Type</th>
  213. <th>Description</th>
  214. </tr>
  215. </thead>
  216. <tbody>
  217. <tr>
  218. <td><span class="xref">T</span></td>
  219. <td><p>the copied component</p>
  220. </td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. <h5 class="typeParameters">Type Parameters</h5>
  225. <table class="table table-bordered table-striped table-condensed">
  226. <thead>
  227. <tr>
  228. <th>Name</th>
  229. <th>Description</th>
  230. </tr>
  231. </thead>
  232. <tbody>
  233. <tr>
  234. <td><span class="parametername">T</span></td>
  235. <td><p>the overriding type</p>
  236. </td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. <h5 id="IPA_Utilities_ReflectionUtil_CopyComponent__1_Component_GameObject_Type__seealso">See Also</h5>
  241. <div class="seealso">
  242. <div><a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_CopyComponent_Component_Type_GameObject_Type_">CopyComponent(Component, Type, GameObject, Type)</a></div>
  243. </div>
  244. <span class="small pull-right mobile-hide">
  245. <span class="divider">|</span>
  246. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/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>
  247. </span>
  248. <span class="small pull-right mobile-hide">
  249. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L39">View Source</a>
  250. </span>
  251. <a id="IPA_Utilities_ReflectionUtil_GetField_" data-uid="IPA.Utilities.ReflectionUtil.GetField*"></a>
  252. <h4 id="IPA_Utilities_ReflectionUtil_GetField__2___1_System_String_" data-uid="IPA.Utilities.ReflectionUtil.GetField``2(``1,System.String)">GetField&lt;U, T&gt;(T, String)</h4>
  253. <div class="markdown level1 summary"><p>Gets the value of a field.</p>
  254. </div>
  255. <div class="markdown level1 conceptual"></div>
  256. <h5 class="decalaration">Declaration</h5>
  257. <div class="codewrapper">
  258. <pre><code class="lang-csharp hljs">public static U GetField&lt;U, T&gt;(this T obj, string fieldName)</code></pre>
  259. </div>
  260. <h5 class="parameters">Parameters</h5>
  261. <table class="table table-bordered table-striped table-condensed">
  262. <thead>
  263. <tr>
  264. <th>Type</th>
  265. <th>Name</th>
  266. <th>Description</th>
  267. </tr>
  268. </thead>
  269. <tbody>
  270. <tr>
  271. <td><span class="xref">T</span></td>
  272. <td><span class="parametername">obj</span></td>
  273. <td><p>the object instance to pull from</p>
  274. </td>
  275. </tr>
  276. <tr>
  277. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  278. <td><span class="parametername">fieldName</span></td>
  279. <td><p>the name of the field to read</p>
  280. </td>
  281. </tr>
  282. </tbody>
  283. </table>
  284. <h5 class="returns">Returns</h5>
  285. <table class="table table-bordered table-striped table-condensed">
  286. <thead>
  287. <tr>
  288. <th>Type</th>
  289. <th>Description</th>
  290. </tr>
  291. </thead>
  292. <tbody>
  293. <tr>
  294. <td><span class="xref">U</span></td>
  295. <td><p>the value of the field</p>
  296. </td>
  297. </tr>
  298. </tbody>
  299. </table>
  300. <h5 class="typeParameters">Type Parameters</h5>
  301. <table class="table table-bordered table-striped table-condensed">
  302. <thead>
  303. <tr>
  304. <th>Name</th>
  305. <th>Description</th>
  306. </tr>
  307. </thead>
  308. <tbody>
  309. <tr>
  310. <td><span class="parametername">U</span></td>
  311. <td><p>the type of the field (result casted)</p>
  312. </td>
  313. </tr>
  314. <tr>
  315. <td><span class="parametername">T</span></td>
  316. <td><p>the type to get the field from</p>
  317. </td>
  318. </tr>
  319. </tbody>
  320. </table>
  321. <h5 id="IPA_Utilities_ReflectionUtil_GetField__2___1_System_String__seealso">See Also</h5>
  322. <div class="seealso">
  323. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Get__0__System_String_">Get(ref T, String)</a></div>
  324. </div>
  325. <span class="small pull-right mobile-hide">
  326. <span class="divider">|</span>
  327. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_ReflectionUtil_GetProperty__2___1_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.ReflectionUtil.GetProperty%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>
  328. </span>
  329. <span class="small pull-right mobile-hide">
  330. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L65">View Source</a>
  331. </span>
  332. <a id="IPA_Utilities_ReflectionUtil_GetProperty_" data-uid="IPA.Utilities.ReflectionUtil.GetProperty*"></a>
  333. <h4 id="IPA_Utilities_ReflectionUtil_GetProperty__2___1_System_String_" data-uid="IPA.Utilities.ReflectionUtil.GetProperty``2(``1,System.String)">GetProperty&lt;U, T&gt;(T, String)</h4>
  334. <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>
  335. </div>
  336. <div class="markdown level1 conceptual"></div>
  337. <h5 class="decalaration">Declaration</h5>
  338. <div class="codewrapper">
  339. <pre><code class="lang-csharp hljs">public static U GetProperty&lt;U, T&gt;(this T obj, string propertyName)</code></pre>
  340. </div>
  341. <h5 class="parameters">Parameters</h5>
  342. <table class="table table-bordered table-striped table-condensed">
  343. <thead>
  344. <tr>
  345. <th>Type</th>
  346. <th>Name</th>
  347. <th>Description</th>
  348. </tr>
  349. </thead>
  350. <tbody>
  351. <tr>
  352. <td><span class="xref">T</span></td>
  353. <td><span class="parametername">obj</span></td>
  354. <td><p>the object instance</p>
  355. </td>
  356. </tr>
  357. <tr>
  358. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  359. <td><span class="parametername">propertyName</span></td>
  360. <td><p>the property to get</p>
  361. </td>
  362. </tr>
  363. </tbody>
  364. </table>
  365. <h5 class="returns">Returns</h5>
  366. <table class="table table-bordered table-striped table-condensed">
  367. <thead>
  368. <tr>
  369. <th>Type</th>
  370. <th>Description</th>
  371. </tr>
  372. </thead>
  373. <tbody>
  374. <tr>
  375. <td><span class="xref">U</span></td>
  376. <td><p>the value of the property</p>
  377. </td>
  378. </tr>
  379. </tbody>
  380. </table>
  381. <h5 class="typeParameters">Type Parameters</h5>
  382. <table class="table table-bordered table-striped table-condensed">
  383. <thead>
  384. <tr>
  385. <th>Name</th>
  386. <th>Description</th>
  387. </tr>
  388. </thead>
  389. <tbody>
  390. <tr>
  391. <td><span class="parametername">U</span></td>
  392. <td><p>the type of the property to get</p>
  393. </td>
  394. </tr>
  395. <tr>
  396. <td><span class="parametername">T</span></td>
  397. <td><p>the type to get the property from</p>
  398. </td>
  399. </tr>
  400. </tbody>
  401. </table>
  402. <h5 id="IPA_Utilities_ReflectionUtil_GetProperty__2___1_System_String__seealso">See Also</h5>
  403. <div class="seealso">
  404. <div><a class="xref" href="IPA.Utilities.PropertyAccessor-2.html#IPA_Utilities_PropertyAccessor_2_Get__0__System_String_">Get(ref T, String)</a></div>
  405. </div>
  406. <span class="small pull-right mobile-hide">
  407. <span class="divider">|</span>
  408. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/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>
  409. </span>
  410. <span class="small pull-right mobile-hide">
  411. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L78">View Source</a>
  412. </span>
  413. <a id="IPA_Utilities_ReflectionUtil_InvokeMethod_" data-uid="IPA.Utilities.ReflectionUtil.InvokeMethod*"></a>
  414. <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;U, T&gt;(T, String, Object[])</h4>
  415. <div class="markdown level1 summary"><p>Invokes a method from <code data-dev-comment-type="typeparamref" class="typeparamref">T</code> on an object.</p>
  416. </div>
  417. <div class="markdown level1 conceptual"></div>
  418. <h5 class="decalaration">Declaration</h5>
  419. <div class="codewrapper">
  420. <pre><code class="lang-csharp hljs">public static U InvokeMethod&lt;U, T&gt;(this T obj, string methodName, params object[] args)</code></pre>
  421. </div>
  422. <h5 class="parameters">Parameters</h5>
  423. <table class="table table-bordered table-striped table-condensed">
  424. <thead>
  425. <tr>
  426. <th>Type</th>
  427. <th>Name</th>
  428. <th>Description</th>
  429. </tr>
  430. </thead>
  431. <tbody>
  432. <tr>
  433. <td><span class="xref">T</span></td>
  434. <td><span class="parametername">obj</span></td>
  435. <td><p>the object instance</p>
  436. </td>
  437. </tr>
  438. <tr>
  439. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  440. <td><span class="parametername">methodName</span></td>
  441. <td><p>the method&apos;s name</p>
  442. </td>
  443. </tr>
  444. <tr>
  445. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a>[]</td>
  446. <td><span class="parametername">args</span></td>
  447. <td><p>the method arguments</p>
  448. </td>
  449. </tr>
  450. </tbody>
  451. </table>
  452. <h5 class="returns">Returns</h5>
  453. <table class="table table-bordered table-striped table-condensed">
  454. <thead>
  455. <tr>
  456. <th>Type</th>
  457. <th>Description</th>
  458. </tr>
  459. </thead>
  460. <tbody>
  461. <tr>
  462. <td><span class="xref">U</span></td>
  463. <td><p>the return value</p>
  464. </td>
  465. </tr>
  466. </tbody>
  467. </table>
  468. <h5 class="typeParameters">Type Parameters</h5>
  469. <table class="table table-bordered table-striped table-condensed">
  470. <thead>
  471. <tr>
  472. <th>Name</th>
  473. <th>Description</th>
  474. </tr>
  475. </thead>
  476. <tbody>
  477. <tr>
  478. <td><span class="parametername">U</span></td>
  479. <td><p>the type that the method returns</p>
  480. </td>
  481. </tr>
  482. <tr>
  483. <td><span class="parametername">T</span></td>
  484. <td><p>the type to search for the method on</p>
  485. </td>
  486. </tr>
  487. </tbody>
  488. </table>
  489. <span class="small pull-right mobile-hide">
  490. <span class="divider">|</span>
  491. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/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>
  492. </span>
  493. <span class="small pull-right mobile-hide">
  494. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L26">View Source</a>
  495. </span>
  496. <a id="IPA_Utilities_ReflectionUtil_SetField_" data-uid="IPA.Utilities.ReflectionUtil.SetField*"></a>
  497. <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>
  498. <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>
  499. </div>
  500. <div class="markdown level1 conceptual"></div>
  501. <h5 class="decalaration">Declaration</h5>
  502. <div class="codewrapper">
  503. <pre><code class="lang-csharp hljs">public static void SetField&lt;T, U&gt;(this T obj, string fieldName, U value)</code></pre>
  504. </div>
  505. <h5 class="parameters">Parameters</h5>
  506. <table class="table table-bordered table-striped table-condensed">
  507. <thead>
  508. <tr>
  509. <th>Type</th>
  510. <th>Name</th>
  511. <th>Description</th>
  512. </tr>
  513. </thead>
  514. <tbody>
  515. <tr>
  516. <td><span class="xref">T</span></td>
  517. <td><span class="parametername">obj</span></td>
  518. <td><p>the object instance</p>
  519. </td>
  520. </tr>
  521. <tr>
  522. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  523. <td><span class="parametername">fieldName</span></td>
  524. <td><p>the field to set</p>
  525. </td>
  526. </tr>
  527. <tr>
  528. <td><span class="xref">U</span></td>
  529. <td><span class="parametername">value</span></td>
  530. <td><p>the value to set it to</p>
  531. </td>
  532. </tr>
  533. </tbody>
  534. </table>
  535. <h5 class="typeParameters">Type Parameters</h5>
  536. <table class="table table-bordered table-striped table-condensed">
  537. <thead>
  538. <tr>
  539. <th>Name</th>
  540. <th>Description</th>
  541. </tr>
  542. </thead>
  543. <tbody>
  544. <tr>
  545. <td><span class="parametername">T</span></td>
  546. <td><p>the type to get the field from</p>
  547. </td>
  548. </tr>
  549. <tr>
  550. <td><span class="parametername">U</span></td>
  551. <td><p>the type of the field to set</p>
  552. </td>
  553. </tr>
  554. </tbody>
  555. </table>
  556. <h5 id="IPA_Utilities_ReflectionUtil_SetField__2___0_System_String___1__seealso">See Also</h5>
  557. <div class="seealso">
  558. <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>
  559. </div>
  560. <span class="small pull-right mobile-hide">
  561. <span class="divider">|</span>
  562. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/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>
  563. </span>
  564. <span class="small pull-right mobile-hide">
  565. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L52">View Source</a>
  566. </span>
  567. <a id="IPA_Utilities_ReflectionUtil_SetProperty_" data-uid="IPA.Utilities.ReflectionUtil.SetProperty*"></a>
  568. <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>
  569. <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>
  570. </div>
  571. <div class="markdown level1 conceptual"></div>
  572. <h5 class="decalaration">Declaration</h5>
  573. <div class="codewrapper">
  574. <pre><code class="lang-csharp hljs">public static void SetProperty&lt;T, U&gt;(this T obj, string propertyName, U value)</code></pre>
  575. </div>
  576. <h5 class="parameters">Parameters</h5>
  577. <table class="table table-bordered table-striped table-condensed">
  578. <thead>
  579. <tr>
  580. <th>Type</th>
  581. <th>Name</th>
  582. <th>Description</th>
  583. </tr>
  584. </thead>
  585. <tbody>
  586. <tr>
  587. <td><span class="xref">T</span></td>
  588. <td><span class="parametername">obj</span></td>
  589. <td><p>the object instance</p>
  590. </td>
  591. </tr>
  592. <tr>
  593. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  594. <td><span class="parametername">propertyName</span></td>
  595. <td><p>the property to set</p>
  596. </td>
  597. </tr>
  598. <tr>
  599. <td><span class="xref">U</span></td>
  600. <td><span class="parametername">value</span></td>
  601. <td><p>the value to set it to</p>
  602. </td>
  603. </tr>
  604. </tbody>
  605. </table>
  606. <h5 class="typeParameters">Type Parameters</h5>
  607. <table class="table table-bordered table-striped table-condensed">
  608. <thead>
  609. <tr>
  610. <th>Name</th>
  611. <th>Description</th>
  612. </tr>
  613. </thead>
  614. <tbody>
  615. <tr>
  616. <td><span class="parametername">T</span></td>
  617. <td><p>the type to get the property from</p>
  618. </td>
  619. </tr>
  620. <tr>
  621. <td><span class="parametername">U</span></td>
  622. <td><p>the type of the property to set</p>
  623. </td>
  624. </tr>
  625. </tbody>
  626. </table>
  627. <h5 id="IPA_Utilities_ReflectionUtil_SetProperty__2___0_System_String___1__seealso">See Also</h5>
  628. <div class="seealso">
  629. <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>
  630. </div>
  631. </article>
  632. </div>
  633. <div class="hidden-sm col-md-2" role="complementary">
  634. <div class="sideaffix">
  635. <div class="contribution">
  636. <ul class="nav">
  637. <li>
  638. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/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>
  639. </li>
  640. <li>
  641. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/3fa908a557fb00196c5729237ae859a2e3804623/IPA.Loader/Utilities/ReflectionUtil.cs/#L11" class="contribution-link">View Source</a>
  642. </li>
  643. </ul>
  644. </div>
  645. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  646. <h5>In This Article</h5>
  647. <div></div>
  648. </nav>
  649. </div>
  650. </div>
  651. </div>
  652. </div>
  653. <footer>
  654. <div class="grad-bottom"></div>
  655. <div class="footer">
  656. <div class="container">
  657. <span class="pull-right">
  658. <a href="#top">Back to top</a>
  659. </span>
  660. <span>Generated by <strong>DocFX</strong></span>
  661. </div>
  662. </div>
  663. </footer>
  664. </div>
  665. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  666. <script type="text/javascript" src="../styles/docfx.js"></script>
  667. <script type="text/javascript" src="../styles/main.js"></script>
  668. </body>
  669. </html>