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.

637 lines
28 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 FieldAccessor&lt;T, U&gt;
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class FieldAccessor&lt;T, U&gt;
  11. ">
  12. <meta name="generator" content="docfx 2.56.2.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.FieldAccessor`2">
  75. <h1 id="IPA_Utilities_FieldAccessor_2" data-uid="IPA.Utilities.FieldAccessor`2" class="text-break">Class FieldAccessor&lt;T, U&gt;
  76. </h1>
  77. <div class="markdown level0 summary"><p>A type containing utilities for accessing non-public fields of objects.</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">FieldAccessor&lt;T, U&gt;</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_FieldAccessor_2_syntax">Syntax</h5>
  112. <div class="codewrapper">
  113. <pre><code class="lang-csharp hljs">public static class FieldAccessor&lt;T, U&gt;</code></pre>
  114. </div>
  115. <h5 class="typeParameters">Type Parameters</h5>
  116. <table class="table table-bordered table-striped table-condensed">
  117. <thead>
  118. <tr>
  119. <th>Name</th>
  120. <th>Description</th>
  121. </tr>
  122. </thead>
  123. <tbody>
  124. <tr>
  125. <td><span class="parametername">T</span></td>
  126. <td><p>the type that the fields are on</p>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td><span class="parametername">U</span></td>
  131. <td><p>the type of the field to access</p>
  132. </td>
  133. </tr>
  134. </tbody>
  135. </table>
  136. <h3 id="methods">Methods
  137. </h3>
  138. <span class="small pull-right mobile-hide">
  139. <span class="divider">|</span>
  140. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_FieldAccessor_2_Access__0__System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.FieldAccessor%602.Access(%600%40%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>
  141. </span>
  142. <span class="small pull-right mobile-hide">
  143. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/18d39fd8b9287aef47f1bfde216c635be17fb708/IPA.Loader/Utilities/Accessor.cs/#L74">View Source</a>
  144. </span>
  145. <a id="IPA_Utilities_FieldAccessor_2_Access_" data-uid="IPA.Utilities.FieldAccessor`2.Access*"></a>
  146. <h4 id="IPA_Utilities_FieldAccessor_2_Access__0__System_String_" data-uid="IPA.Utilities.FieldAccessor`2.Access(`0@,System.String)">Access(ref T, String)</h4>
  147. <div class="markdown level1 summary"><p>Accesses a field for an object by name.</p>
  148. </div>
  149. <div class="markdown level1 conceptual"></div>
  150. <h5 class="decalaration">Declaration</h5>
  151. <div class="codewrapper">
  152. <pre><code class="lang-csharp hljs">public static U Access(ref T obj, string name)</code></pre>
  153. </div>
  154. <h5 class="parameters">Parameters</h5>
  155. <table class="table table-bordered table-striped table-condensed">
  156. <thead>
  157. <tr>
  158. <th>Type</th>
  159. <th>Name</th>
  160. <th>Description</th>
  161. </tr>
  162. </thead>
  163. <tbody>
  164. <tr>
  165. <td><span class="xref">T</span></td>
  166. <td><span class="parametername">obj</span></td>
  167. <td><p>the object to access the field of</p>
  168. </td>
  169. </tr>
  170. <tr>
  171. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  172. <td><span class="parametername">name</span></td>
  173. <td><p>the name of the field to access</p>
  174. </td>
  175. </tr>
  176. </tbody>
  177. </table>
  178. <h5 class="returns">Returns</h5>
  179. <table class="table table-bordered table-striped table-condensed">
  180. <thead>
  181. <tr>
  182. <th>Type</th>
  183. <th>Description</th>
  184. </tr>
  185. </thead>
  186. <tbody>
  187. <tr>
  188. <td><span class="xref">U</span></td>
  189. <td><p>a reference to the object at the field</p>
  190. </td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. <h5 class="exceptions">Exceptions</h5>
  195. <table class="table table-bordered table-striped table-condensed">
  196. <thead>
  197. <tr>
  198. <th>Type</th>
  199. <th>Condition</th>
  200. </tr>
  201. </thead>
  202. <tbody>
  203. <tr>
  204. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  205. <td><p>if the field does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  206. </td>
  207. </tr>
  208. </tbody>
  209. </table>
  210. <h5 id="IPA_Utilities_FieldAccessor_2_Access__0__System_String__seealso">See Also</h5>
  211. <div class="seealso">
  212. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_GetAccessor_System_String_">GetAccessor(String)</a></div>
  213. </div>
  214. <span class="small pull-right mobile-hide">
  215. <span class="divider">|</span>
  216. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_FieldAccessor_2_Get__0_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.FieldAccessor%602.Get(%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>
  217. </span>
  218. <span class="small pull-right mobile-hide">
  219. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/18d39fd8b9287aef47f1bfde216c635be17fb708/IPA.Loader/Utilities/Accessor.cs/#L100">View Source</a>
  220. </span>
  221. <a id="IPA_Utilities_FieldAccessor_2_Get_" data-uid="IPA.Utilities.FieldAccessor`2.Get*"></a>
  222. <h4 id="IPA_Utilities_FieldAccessor_2_Get__0_System_String_" data-uid="IPA.Utilities.FieldAccessor`2.Get(`0,System.String)">Get(T, String)</h4>
  223. <div class="markdown level1 summary"><p>Gets the value of a field of an object by name.</p>
  224. </div>
  225. <div class="markdown level1 conceptual"></div>
  226. <h5 class="decalaration">Declaration</h5>
  227. <div class="codewrapper">
  228. <pre><code class="lang-csharp hljs">public static U Get(T obj, string name)</code></pre>
  229. </div>
  230. <h5 class="parameters">Parameters</h5>
  231. <table class="table table-bordered table-striped table-condensed">
  232. <thead>
  233. <tr>
  234. <th>Type</th>
  235. <th>Name</th>
  236. <th>Description</th>
  237. </tr>
  238. </thead>
  239. <tbody>
  240. <tr>
  241. <td><span class="xref">T</span></td>
  242. <td><span class="parametername">obj</span></td>
  243. <td><p>the object to access the field of</p>
  244. </td>
  245. </tr>
  246. <tr>
  247. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  248. <td><span class="parametername">name</span></td>
  249. <td><p>the name of the field to access</p>
  250. </td>
  251. </tr>
  252. </tbody>
  253. </table>
  254. <h5 class="returns">Returns</h5>
  255. <table class="table table-bordered table-striped table-condensed">
  256. <thead>
  257. <tr>
  258. <th>Type</th>
  259. <th>Description</th>
  260. </tr>
  261. </thead>
  262. <tbody>
  263. <tr>
  264. <td><span class="xref">U</span></td>
  265. <td><p>the value of the field</p>
  266. </td>
  267. </tr>
  268. </tbody>
  269. </table>
  270. <h5 class="exceptions">Exceptions</h5>
  271. <table class="table table-bordered table-striped table-condensed">
  272. <thead>
  273. <tr>
  274. <th>Type</th>
  275. <th>Condition</th>
  276. </tr>
  277. </thead>
  278. <tbody>
  279. <tr>
  280. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  281. <td><p>if the field does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  282. </td>
  283. </tr>
  284. </tbody>
  285. </table>
  286. <h5 id="IPA_Utilities_FieldAccessor_2_Get__0_System_String__seealso">See Also</h5>
  287. <div class="seealso">
  288. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Get__0__System_String_">Get(ref T, String)</a></div>
  289. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Access__0__System_String_">Access(ref T, String)</a></div>
  290. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_GetAccessor_System_String_">GetAccessor(String)</a></div>
  291. </div>
  292. <span class="small pull-right mobile-hide">
  293. <span class="divider">|</span>
  294. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_FieldAccessor_2_Get__0__System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.FieldAccessor%602.Get(%600%40%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>
  295. </span>
  296. <span class="small pull-right mobile-hide">
  297. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/18d39fd8b9287aef47f1bfde216c635be17fb708/IPA.Loader/Utilities/Accessor.cs/#L89">View Source</a>
  298. </span>
  299. <a id="IPA_Utilities_FieldAccessor_2_Get_" data-uid="IPA.Utilities.FieldAccessor`2.Get*"></a>
  300. <h4 id="IPA_Utilities_FieldAccessor_2_Get__0__System_String_" data-uid="IPA.Utilities.FieldAccessor`2.Get(`0@,System.String)">Get(ref T, String)</h4>
  301. <div class="markdown level1 summary"><p>Gets the value of a field of an object by name.</p>
  302. </div>
  303. <div class="markdown level1 conceptual"></div>
  304. <h5 class="decalaration">Declaration</h5>
  305. <div class="codewrapper">
  306. <pre><code class="lang-csharp hljs">public static U Get(ref T obj, string name)</code></pre>
  307. </div>
  308. <h5 class="parameters">Parameters</h5>
  309. <table class="table table-bordered table-striped table-condensed">
  310. <thead>
  311. <tr>
  312. <th>Type</th>
  313. <th>Name</th>
  314. <th>Description</th>
  315. </tr>
  316. </thead>
  317. <tbody>
  318. <tr>
  319. <td><span class="xref">T</span></td>
  320. <td><span class="parametername">obj</span></td>
  321. <td><p>the object to access the field of</p>
  322. </td>
  323. </tr>
  324. <tr>
  325. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  326. <td><span class="parametername">name</span></td>
  327. <td><p>the name of the field to access</p>
  328. </td>
  329. </tr>
  330. </tbody>
  331. </table>
  332. <h5 class="returns">Returns</h5>
  333. <table class="table table-bordered table-striped table-condensed">
  334. <thead>
  335. <tr>
  336. <th>Type</th>
  337. <th>Description</th>
  338. </tr>
  339. </thead>
  340. <tbody>
  341. <tr>
  342. <td><span class="xref">U</span></td>
  343. <td><p>the value of the field</p>
  344. </td>
  345. </tr>
  346. </tbody>
  347. </table>
  348. <h5 id="IPA_Utilities_FieldAccessor_2_Get__0__System_String__remarks">Remarks</h5>
  349. <div class="markdown level1 remarks"><p>The only good reason to use this over <a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Get__0_System_String_">Get(T, String)</a> is when you are working with a value type,
  350. as it prevents a copy.</p>
  351. </div>
  352. <h5 class="exceptions">Exceptions</h5>
  353. <table class="table table-bordered table-striped table-condensed">
  354. <thead>
  355. <tr>
  356. <th>Type</th>
  357. <th>Condition</th>
  358. </tr>
  359. </thead>
  360. <tbody>
  361. <tr>
  362. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  363. <td><p>if the field does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  364. </td>
  365. </tr>
  366. </tbody>
  367. </table>
  368. <h5 id="IPA_Utilities_FieldAccessor_2_Get__0__System_String__seealso">See Also</h5>
  369. <div class="seealso">
  370. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Get__0_System_String_">Get(T, String)</a></div>
  371. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Access__0__System_String_">Access(ref T, String)</a></div>
  372. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_GetAccessor_System_String_">GetAccessor(String)</a></div>
  373. </div>
  374. <span class="small pull-right mobile-hide">
  375. <span class="divider">|</span>
  376. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_FieldAccessor_2_GetAccessor_System_String_.md&amp;value=---%0Auid%3A%20IPA.Utilities.FieldAccessor%602.GetAccessor(System.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>
  377. </span>
  378. <span class="small pull-right mobile-hide">
  379. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/18d39fd8b9287aef47f1bfde216c635be17fb708/IPA.Loader/Utilities/Accessor.cs/#L63">View Source</a>
  380. </span>
  381. <a id="IPA_Utilities_FieldAccessor_2_GetAccessor_" data-uid="IPA.Utilities.FieldAccessor`2.GetAccessor*"></a>
  382. <h4 id="IPA_Utilities_FieldAccessor_2_GetAccessor_System_String_" data-uid="IPA.Utilities.FieldAccessor`2.GetAccessor(System.String)">GetAccessor(String)</h4>
  383. <div class="markdown level1 summary"><p>Gets an <a class="xref" href="IPA.Utilities.FieldAccessor-2.Accessor.html">FieldAccessor&lt;T, U&gt;.Accessor</a> for the field named <code data-dev-comment-type="paramref" class="paramref">name</code> on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code>.</p>
  384. </div>
  385. <div class="markdown level1 conceptual"></div>
  386. <h5 class="decalaration">Declaration</h5>
  387. <div class="codewrapper">
  388. <pre><code class="lang-csharp hljs">public static FieldAccessor&lt;T, U&gt;.Accessor GetAccessor(string name)</code></pre>
  389. </div>
  390. <h5 class="parameters">Parameters</h5>
  391. <table class="table table-bordered table-striped table-condensed">
  392. <thead>
  393. <tr>
  394. <th>Type</th>
  395. <th>Name</th>
  396. <th>Description</th>
  397. </tr>
  398. </thead>
  399. <tbody>
  400. <tr>
  401. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  402. <td><span class="parametername">name</span></td>
  403. <td><p>the field name</p>
  404. </td>
  405. </tr>
  406. </tbody>
  407. </table>
  408. <h5 class="returns">Returns</h5>
  409. <table class="table table-bordered table-striped table-condensed">
  410. <thead>
  411. <tr>
  412. <th>Type</th>
  413. <th>Description</th>
  414. </tr>
  415. </thead>
  416. <tbody>
  417. <tr>
  418. <td><a class="xref" href="IPA.Utilities.FieldAccessor-2.Accessor.html">FieldAccessor.Accessor</a>&lt;&gt;</td>
  419. <td><p>an accessor for the field</p>
  420. </td>
  421. </tr>
  422. </tbody>
  423. </table>
  424. <h5 class="exceptions">Exceptions</h5>
  425. <table class="table table-bordered table-striped table-condensed">
  426. <thead>
  427. <tr>
  428. <th>Type</th>
  429. <th>Condition</th>
  430. </tr>
  431. </thead>
  432. <tbody>
  433. <tr>
  434. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  435. <td><p>if the field does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  436. </td>
  437. </tr>
  438. </tbody>
  439. </table>
  440. <span class="small pull-right mobile-hide">
  441. <span class="divider">|</span>
  442. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_FieldAccessor_2_Set__0_System_String__1_.md&amp;value=---%0Auid%3A%20IPA.Utilities.FieldAccessor%602.Set(%600%2CSystem.String%2C%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>
  443. </span>
  444. <span class="small pull-right mobile-hide">
  445. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/18d39fd8b9287aef47f1bfde216c635be17fb708/IPA.Loader/Utilities/Accessor.cs/#L128">View Source</a>
  446. </span>
  447. <a id="IPA_Utilities_FieldAccessor_2_Set_" data-uid="IPA.Utilities.FieldAccessor`2.Set*"></a>
  448. <h4 id="IPA_Utilities_FieldAccessor_2_Set__0_System_String__1_" data-uid="IPA.Utilities.FieldAccessor`2.Set(`0,System.String,`1)">Set(T, String, U)</h4>
  449. <div class="markdown level1 summary"><p>Sets the value of a field for an object by name.</p>
  450. </div>
  451. <div class="markdown level1 conceptual"></div>
  452. <h5 class="decalaration">Declaration</h5>
  453. <div class="codewrapper">
  454. <pre><code class="lang-csharp hljs">public static void Set(T obj, string name, U value)</code></pre>
  455. </div>
  456. <h5 class="parameters">Parameters</h5>
  457. <table class="table table-bordered table-striped table-condensed">
  458. <thead>
  459. <tr>
  460. <th>Type</th>
  461. <th>Name</th>
  462. <th>Description</th>
  463. </tr>
  464. </thead>
  465. <tbody>
  466. <tr>
  467. <td><span class="xref">T</span></td>
  468. <td><span class="parametername">obj</span></td>
  469. <td><p>the object to set the field of</p>
  470. </td>
  471. </tr>
  472. <tr>
  473. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  474. <td><span class="parametername">name</span></td>
  475. <td><p>the name of the field</p>
  476. </td>
  477. </tr>
  478. <tr>
  479. <td><span class="xref">U</span></td>
  480. <td><span class="parametername">value</span></td>
  481. <td><p>the value to set it to</p>
  482. </td>
  483. </tr>
  484. </tbody>
  485. </table>
  486. <h5 id="IPA_Utilities_FieldAccessor_2_Set__0_System_String__1__remarks">Remarks</h5>
  487. <div class="markdown level1 remarks"><p>This overload cannot be safely used for value types. Use <a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Set__0__System_String__1_">Set(ref T, String, U)</a> instead.</p>
  488. </div>
  489. <h5 class="exceptions">Exceptions</h5>
  490. <table class="table table-bordered table-striped table-condensed">
  491. <thead>
  492. <tr>
  493. <th>Type</th>
  494. <th>Condition</th>
  495. </tr>
  496. </thead>
  497. <tbody>
  498. <tr>
  499. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  500. <td><p>if the field does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  501. </td>
  502. </tr>
  503. </tbody>
  504. </table>
  505. <h5 id="IPA_Utilities_FieldAccessor_2_Set__0_System_String__1__seealso">See Also</h5>
  506. <div class="seealso">
  507. <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>
  508. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Access__0__System_String_">Access(ref T, String)</a></div>
  509. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_GetAccessor_System_String_">GetAccessor(String)</a></div>
  510. </div>
  511. <span class="small pull-right mobile-hide">
  512. <span class="divider">|</span>
  513. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_FieldAccessor_2_Set__0__System_String__1_.md&amp;value=---%0Auid%3A%20IPA.Utilities.FieldAccessor%602.Set(%600%40%2CSystem.String%2C%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>
  514. </span>
  515. <span class="small pull-right mobile-hide">
  516. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/18d39fd8b9287aef47f1bfde216c635be17fb708/IPA.Loader/Utilities/Accessor.cs/#L114">View Source</a>
  517. </span>
  518. <a id="IPA_Utilities_FieldAccessor_2_Set_" data-uid="IPA.Utilities.FieldAccessor`2.Set*"></a>
  519. <h4 id="IPA_Utilities_FieldAccessor_2_Set__0__System_String__1_" data-uid="IPA.Utilities.FieldAccessor`2.Set(`0@,System.String,`1)">Set(ref T, String, U)</h4>
  520. <div class="markdown level1 summary"><p>Sets the value of a field for an object by name.</p>
  521. </div>
  522. <div class="markdown level1 conceptual"></div>
  523. <h5 class="decalaration">Declaration</h5>
  524. <div class="codewrapper">
  525. <pre><code class="lang-csharp hljs">public static void Set(ref T obj, string name, U value)</code></pre>
  526. </div>
  527. <h5 class="parameters">Parameters</h5>
  528. <table class="table table-bordered table-striped table-condensed">
  529. <thead>
  530. <tr>
  531. <th>Type</th>
  532. <th>Name</th>
  533. <th>Description</th>
  534. </tr>
  535. </thead>
  536. <tbody>
  537. <tr>
  538. <td><span class="xref">T</span></td>
  539. <td><span class="parametername">obj</span></td>
  540. <td><p>the object to set the field of</p>
  541. </td>
  542. </tr>
  543. <tr>
  544. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.string">String</a></td>
  545. <td><span class="parametername">name</span></td>
  546. <td><p>the name of the field</p>
  547. </td>
  548. </tr>
  549. <tr>
  550. <td><span class="xref">U</span></td>
  551. <td><span class="parametername">value</span></td>
  552. <td><p>the value to set it to</p>
  553. </td>
  554. </tr>
  555. </tbody>
  556. </table>
  557. <h5 id="IPA_Utilities_FieldAccessor_2_Set__0__System_String__1__remarks">Remarks</h5>
  558. <div class="markdown level1 remarks"><p>This overload must be used for value types.</p>
  559. </div>
  560. <h5 class="exceptions">Exceptions</h5>
  561. <table class="table table-bordered table-striped table-condensed">
  562. <thead>
  563. <tr>
  564. <th>Type</th>
  565. <th>Condition</th>
  566. </tr>
  567. </thead>
  568. <tbody>
  569. <tr>
  570. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.missingfieldexception">MissingFieldException</a></td>
  571. <td><p>if the field does not exist on <code data-dev-comment-type="typeparamref" class="typeparamref">T</code></p>
  572. </td>
  573. </tr>
  574. </tbody>
  575. </table>
  576. <h5 id="IPA_Utilities_FieldAccessor_2_Set__0__System_String__1__seealso">See Also</h5>
  577. <div class="seealso">
  578. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Set__0_System_String__1_">Set(T, String, U)</a></div>
  579. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_Access__0__System_String_">Access(ref T, String)</a></div>
  580. <div><a class="xref" href="IPA.Utilities.FieldAccessor-2.html#IPA_Utilities_FieldAccessor_2_GetAccessor_System_String_">GetAccessor(String)</a></div>
  581. </div>
  582. <h3 id="seealso">See Also</h3>
  583. <div class="seealso">
  584. <div><a class="xref" href="IPA.Utilities.PropertyAccessor-2.html">PropertyAccessor</a>&lt;T, U&gt;</div>
  585. </div>
  586. </article>
  587. </div>
  588. <div class="hidden-sm col-md-2" role="complementary">
  589. <div class="sideaffix">
  590. <div class="contribution">
  591. <ul class="nav">
  592. <li>
  593. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Utilities_FieldAccessor_2.md&amp;value=---%0Auid%3A%20IPA.Utilities.FieldAccessor%602%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>
  594. </li>
  595. <li>
  596. <a href="https://github.com/bsmg/BeatSaber-IPA-Reloaded/blob/18d39fd8b9287aef47f1bfde216c635be17fb708/IPA.Loader/Utilities/Accessor.cs/#L22" class="contribution-link">View Source</a>
  597. </li>
  598. </ul>
  599. </div>
  600. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  601. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  602. </nav>
  603. </div>
  604. </div>
  605. </div>
  606. </div>
  607. <footer>
  608. <div class="grad-bottom"></div>
  609. <div class="footer">
  610. <div class="container">
  611. <span class="pull-right">
  612. <a href="#top">Back to top</a>
  613. </span>
  614. <span>Generated by <strong>DocFX</strong></span>
  615. </div>
  616. </div>
  617. </footer>
  618. </div>
  619. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  620. <script type="text/javascript" src="../styles/docfx.js"></script>
  621. <script type="text/javascript" src="../styles/main.js"></script>
  622. </body>
  623. </html>