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.

317 lines
16 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>Interface IValueConverter
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Interface IValueConverter
  11. ">
  12. <meta name="generator" content="docfx 2.48.0.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.Config.Stores.IValueConverter">
  75. <h1 id="IPA_Config_Stores_IValueConverter" data-uid="IPA.Config.Stores.IValueConverter" class="text-break">Interface IValueConverter
  76. </h1>
  77. <div class="markdown level0 summary"><p>The base interface for a value converter for use by objects generated by
  78. <a class="xref" href="IPA.Config.Stores.GeneratedStore.html#IPA_Config_Stores_GeneratedStore_Generated__1_IPA_Config_Config_System_Boolean_">Generated&lt;T&gt;(Config, Boolean)</a>.</p>
  79. </div>
  80. <div class="markdown level0 conceptual"></div>
  81. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Config.Stores.html">IPA.Config.Stores</a></h6>
  82. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  83. <h5 id="IPA_Config_Stores_IValueConverter_syntax">Syntax</h5>
  84. <div class="codewrapper">
  85. <pre><code class="lang-csharp hljs">public interface IValueConverter</code></pre>
  86. </div>
  87. <h5 id="IPA_Config_Stores_IValueConverter_remarks"><strong>Remarks</strong></h5>
  88. <div class="markdown level0 remarks"><p>
  89. The object returned from <a class="xref" href="IPA.Config.Stores.IValueConverter.html#IPA_Config_Stores_IValueConverter_FromValue_IPA_Config_Data_Value_System_Object_">FromValue(Value, Object)</a>, if fed into <a class="xref" href="IPA.Config.Stores.IValueConverter.html#IPA_Config_Stores_IValueConverter_ToValue_System_Object_System_Object_">ToValue(Object, Object)</a>,
  90. should return equivalent <a class="xref" href="IPA.Config.Data.Value.html">Value</a> structures. Similarly, if the result of <a class="xref" href="IPA.Config.Stores.IValueConverter.html#IPA_Config_Stores_IValueConverter_ToValue_System_Object_System_Object_">ToValue(Object, Object)</a>
  91. is fed into <a class="xref" href="IPA.Config.Stores.IValueConverter.html#IPA_Config_Stores_IValueConverter_FromValue_IPA_Config_Data_Value_System_Object_">FromValue(Value, Object)</a>, the resulting object should be equivalent to the one passed to
  92. <a class="xref" href="IPA.Config.Stores.IValueConverter.html#IPA_Config_Stores_IValueConverter_ToValue_System_Object_System_Object_">ToValue(Object, Object)</a>.
  93. </p>
  94. <p>
  95. The <code>parent</code> parameter to <a class="xref" href="IPA.Config.Stores.IValueConverter.html#IPA_Config_Stores_IValueConverter_ToValue_System_Object_System_Object_">ToValue(Object, Object)</a> and <a class="xref" href="IPA.Config.Stores.IValueConverter.html#IPA_Config_Stores_IValueConverter_FromValue_IPA_Config_Data_Value_System_Object_">FromValue(Value, Object)</a> should
  96. be (ideally) the the top of the serialization tree, or some other generated object in that tree, rather than some arbitrary
  97. object in the middle that is not managed by the generatd config system.
  98. </p>
  99. <p>
  100. Converters do <em>not</em> need to perform null checks, as the serializer and deserializer will do that automatically.
  101. </p>
  102. </div>
  103. <h3 id="properties">Properties
  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/docs/override/new?filename=IPA_Config_Stores_IValueConverter_Type.md&amp;value=---%0Auid%3A%20IPA.Config.Stores.IValueConverter.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>
  108. </span>
  109. <span class="small pull-right mobile-hide">
  110. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/0d67058090bdf3acbc45a4b2b8d20f7f9149580a/IPA.Loader/Config/Stores/ValueConverter.cs/#L45">View Source</a>
  111. </span>
  112. <a id="IPA_Config_Stores_IValueConverter_Type_" data-uid="IPA.Config.Stores.IValueConverter.Type*"></a>
  113. <h4 id="IPA_Config_Stores_IValueConverter_Type" data-uid="IPA.Config.Stores.IValueConverter.Type">Type</h4>
  114. <div class="markdown level1 summary"><p>Gets the type that this <a class="xref" href="IPA.Config.Stores.IValueConverter.html">IValueConverter</a> handles.</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">Type Type { get; }</code></pre>
  120. </div>
  121. <h5 class="propertyValue">Property Value</h5>
  122. <table class="table table-bordered table-striped table-condensed">
  123. <thead>
  124. <tr>
  125. <th>Type</th>
  126. <th>Description</th>
  127. </tr>
  128. </thead>
  129. <tbody>
  130. <tr>
  131. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.type">Type</a></td>
  132. <td></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/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Config_Stores_IValueConverter_FromValue_IPA_Config_Data_Value_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Config.Stores.IValueConverter.FromValue(IPA.Config.Data.Value%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>
  141. </span>
  142. <span class="small pull-right mobile-hide">
  143. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/0d67058090bdf3acbc45a4b2b8d20f7f9149580a/IPA.Loader/Config/Stores/ValueConverter.cs/#L41">View Source</a>
  144. </span>
  145. <a id="IPA_Config_Stores_IValueConverter_FromValue_" data-uid="IPA.Config.Stores.IValueConverter.FromValue*"></a>
  146. <h4 id="IPA_Config_Stores_IValueConverter_FromValue_IPA_Config_Data_Value_System_Object_" data-uid="IPA.Config.Stores.IValueConverter.FromValue(IPA.Config.Data.Value,System.Object)">FromValue(Value, Object)</h4>
  147. <div class="markdown level1 summary"><p>Converts the given <a class="xref" href="IPA.Config.Data.Value.html">Value</a> to the object type handled by this converter.</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">object FromValue(Value value, object parent)</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><a class="xref" href="IPA.Config.Data.Value.html">Value</a></td>
  166. <td><span class="parametername">value</span></td>
  167. <td><p>the <a class="xref" href="IPA.Config.Data.Value.html">Value</a> to deserialize</p>
  168. </td>
  169. </tr>
  170. <tr>
  171. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  172. <td><span class="parametername">parent</span></td>
  173. <td><p>the object that will own the result</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><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  189. <td><p>the deserialized object</p>
  190. </td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. <span class="small pull-right mobile-hide">
  195. <span class="divider">|</span>
  196. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Config_Stores_IValueConverter_ToValue_System_Object_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Config.Stores.IValueConverter.ToValue(System.Object%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>
  197. </span>
  198. <span class="small pull-right mobile-hide">
  199. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/0d67058090bdf3acbc45a4b2b8d20f7f9149580a/IPA.Loader/Config/Stores/ValueConverter.cs/#L34">View Source</a>
  200. </span>
  201. <a id="IPA_Config_Stores_IValueConverter_ToValue_" data-uid="IPA.Config.Stores.IValueConverter.ToValue*"></a>
  202. <h4 id="IPA_Config_Stores_IValueConverter_ToValue_System_Object_System_Object_" data-uid="IPA.Config.Stores.IValueConverter.ToValue(System.Object,System.Object)">ToValue(Object, Object)</h4>
  203. <div class="markdown level1 summary"><p>Converts the given object to a <a class="xref" href="IPA.Config.Data.Value.html">Value</a>.</p>
  204. </div>
  205. <div class="markdown level1 conceptual"></div>
  206. <h5 class="decalaration">Declaration</h5>
  207. <div class="codewrapper">
  208. <pre><code class="lang-csharp hljs">Value ToValue(object obj, object parent)</code></pre>
  209. </div>
  210. <h5 class="parameters">Parameters</h5>
  211. <table class="table table-bordered table-striped table-condensed">
  212. <thead>
  213. <tr>
  214. <th>Type</th>
  215. <th>Name</th>
  216. <th>Description</th>
  217. </tr>
  218. </thead>
  219. <tbody>
  220. <tr>
  221. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  222. <td><span class="parametername">obj</span></td>
  223. <td><p>the object to convert</p>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  228. <td><span class="parametername">parent</span></td>
  229. <td><p>the owning object of <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  230. </td>
  231. </tr>
  232. </tbody>
  233. </table>
  234. <h5 class="returns">Returns</h5>
  235. <table class="table table-bordered table-striped table-condensed">
  236. <thead>
  237. <tr>
  238. <th>Type</th>
  239. <th>Description</th>
  240. </tr>
  241. </thead>
  242. <tbody>
  243. <tr>
  244. <td><a class="xref" href="IPA.Config.Data.Value.html">Value</a></td>
  245. <td><p>a representation of <code data-dev-comment-type="paramref" class="paramref">obj</code> as a <a class="xref" href="IPA.Config.Data.Value.html">Value</a> structure</p>
  246. </td>
  247. </tr>
  248. </tbody>
  249. </table>
  250. <h3 id="extensionmethods">Extension Methods</h3>
  251. <div>
  252. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetField__2___0_System_String___1_">ReflectionUtil.SetField&lt;T, U&gt;(T, String, U)</a>
  253. </div>
  254. <div>
  255. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetField__2___1_System_String_">ReflectionUtil.GetField&lt;U, T&gt;(T, String)</a>
  256. </div>
  257. <div>
  258. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetProperty__2___0_System_String___1_">ReflectionUtil.SetProperty&lt;T, U&gt;(T, String, U)</a>
  259. </div>
  260. <div>
  261. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetProperty__2___1_System_String_">ReflectionUtil.GetProperty&lt;U, T&gt;(T, String)</a>
  262. </div>
  263. <div>
  264. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object___">ReflectionUtil.InvokeMethod&lt;U, T&gt;(T, String, Object[])</a>
  265. </div>
  266. </article>
  267. </div>
  268. <div class="hidden-sm col-md-2" role="complementary">
  269. <div class="sideaffix">
  270. <div class="contribution">
  271. <ul class="nav">
  272. <li>
  273. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Config_Stores_IValueConverter.md&amp;value=---%0Auid%3A%20IPA.Config.Stores.IValueConverter%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>
  274. </li>
  275. <li>
  276. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/0d67058090bdf3acbc45a4b2b8d20f7f9149580a/IPA.Loader/Config/Stores/ValueConverter.cs/#L26" class="contribution-link">View Source</a>
  277. </li>
  278. </ul>
  279. </div>
  280. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  281. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  282. </nav>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. <footer>
  288. <div class="grad-bottom"></div>
  289. <div class="footer">
  290. <div class="container">
  291. <span class="pull-right">
  292. <a href="#top">Back to top</a>
  293. </span>
  294. <span>Generated by <strong>DocFX</strong></span>
  295. </div>
  296. </div>
  297. </footer>
  298. </div>
  299. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  300. <script type="text/javascript" src="../styles/docfx.js"></script>
  301. <script type="text/javascript" src="../styles/main.js"></script>
  302. </body>
  303. </html>