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.

314 lines
15 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 NumericEnumConverter&lt;T&gt;
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class NumericEnumConverter&lt;T&gt;
  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.Config.Stores.Converters.NumericEnumConverter`1">
  75. <h1 id="IPA_Config_Stores_Converters_NumericEnumConverter_1" data-uid="IPA.Config.Stores.Converters.NumericEnumConverter`1" class="text-break">Class NumericEnumConverter&lt;T&gt;
  76. </h1>
  77. <div class="markdown level0 summary"><p>A converter for an enum of type <code data-dev-comment-type="typeparamref" class="typeparamref">T</code>, that converts the enum to its underlying value for serialization.</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"><a class="xref" href="IPA.Config.Stores.ValueConverter-1.html">ValueConverter</a>&lt;T&gt;</div>
  84. <div class="level2"><span class="xref">NumericEnumConverter&lt;T&gt;</span></div>
  85. </div>
  86. <div class="implements">
  87. <h5>Implements</h5>
  88. <div><a class="xref" href="IPA.Config.Stores.IValueConverter.html">IValueConverter</a></div>
  89. </div>
  90. <div class="inheritedMembers">
  91. <h5>Inherited Members</h5>
  92. <div>
  93. <a class="xref" href="IPA.Config.Stores.ValueConverter-1.html#IPA_Config_Stores_ValueConverter_1_IPA_Config_Stores_IValueConverter_ToValue_System_Nullable_System_Object__System_Object_">ValueConverter&lt;T&gt;.IValueConverter.ToValue(Nullable&lt;Object&gt;, Object)</a>
  94. </div>
  95. <div>
  96. <a class="xref" href="IPA.Config.Stores.ValueConverter-1.html#IPA_Config_Stores_ValueConverter_1_IPA_Config_Stores_IValueConverter_FromValue_IPA_Config_Data_Value_System_Object_">ValueConverter&lt;T&gt;.IValueConverter.FromValue(Value, Object)</a>
  97. </div>
  98. <div>
  99. <a class="xref" href="IPA.Config.Stores.ValueConverter-1.html#IPA_Config_Stores_ValueConverter_1_IPA_Config_Stores_IValueConverter_Type">ValueConverter&lt;T&gt;.IValueConverter.Type</a>
  100. </div>
  101. </div>
  102. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.Config.Stores.Converters.html">IPA.Config.Stores.Converters</a></h6>
  103. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  104. <h5 id="IPA_Config_Stores_Converters_NumericEnumConverter_1_syntax">Syntax</h5>
  105. <div class="codewrapper">
  106. <pre><code class="lang-csharp hljs">public sealed class NumericEnumConverter&lt;T&gt; : ValueConverter&lt;T&gt;, IValueConverter where T : Enum</code></pre>
  107. </div>
  108. <h5 class="typeParameters">Type Parameters</h5>
  109. <table class="table table-bordered table-striped table-condensed">
  110. <thead>
  111. <tr>
  112. <th>Name</th>
  113. <th>Description</th>
  114. </tr>
  115. </thead>
  116. <tbody>
  117. <tr>
  118. <td><span class="parametername">T</span></td>
  119. <td><p>the enum type</p>
  120. </td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. <h3 id="methods">Methods
  125. </h3>
  126. <span class="small pull-right mobile-hide">
  127. <span class="divider">|</span>
  128. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Config_Stores_Converters_NumericEnumConverter_1_FromValue_IPA_Config_Data_Value_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Config.Stores.Converters.NumericEnumConverter%601.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>
  129. </span>
  130. <span class="small pull-right mobile-hide">
  131. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Config/Stores/Converters.cs/#L300">View Source</a>
  132. </span>
  133. <a id="IPA_Config_Stores_Converters_NumericEnumConverter_1_FromValue_" data-uid="IPA.Config.Stores.Converters.NumericEnumConverter`1.FromValue*"></a>
  134. <h4 id="IPA_Config_Stores_Converters_NumericEnumConverter_1_FromValue_IPA_Config_Data_Value_System_Object_" data-uid="IPA.Config.Stores.Converters.NumericEnumConverter`1.FromValue(IPA.Config.Data.Value,System.Object)">FromValue(Value, Object)</h4>
  135. <div class="markdown level1 summary"><p>Converts a <a class="xref" href="IPA.Config.Data.Value.html">Value</a> that is a numeric node to the corresponding enum value.</p>
  136. </div>
  137. <div class="markdown level1 conceptual"></div>
  138. <h5 class="decalaration">Declaration</h5>
  139. <div class="codewrapper">
  140. <pre><code class="lang-csharp hljs">public override T FromValue(Value value, object parent)</code></pre>
  141. </div>
  142. <h5 class="parameters">Parameters</h5>
  143. <table class="table table-bordered table-striped table-condensed">
  144. <thead>
  145. <tr>
  146. <th>Type</th>
  147. <th>Name</th>
  148. <th>Description</th>
  149. </tr>
  150. </thead>
  151. <tbody>
  152. <tr>
  153. <td><a class="xref" href="IPA.Config.Data.Value.html">Value</a></td>
  154. <td><span class="parametername">value</span></td>
  155. <td><p>the <a class="xref" href="IPA.Config.Data.Value.html">Value</a> to convert</p>
  156. </td>
  157. </tr>
  158. <tr>
  159. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  160. <td><span class="parametername">parent</span></td>
  161. <td><p>the object which will own the created object</p>
  162. </td>
  163. </tr>
  164. </tbody>
  165. </table>
  166. <h5 class="returns">Returns</h5>
  167. <table class="table table-bordered table-striped table-condensed">
  168. <thead>
  169. <tr>
  170. <th>Type</th>
  171. <th>Description</th>
  172. </tr>
  173. </thead>
  174. <tbody>
  175. <tr>
  176. <td><span class="xref">T</span></td>
  177. <td><p>the deserialized enum value</p>
  178. </td>
  179. </tr>
  180. </tbody>
  181. </table>
  182. <h5 class="overrides">Overrides</h5>
  183. <div><span class="xref">IPA.Config.Stores.ValueConverter&lt;T&gt;.FromValue(IPA.Config.Data.Value, System.Object)</span></div>
  184. <span class="small pull-right mobile-hide">
  185. <span class="divider">|</span>
  186. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Config_Stores_Converters_NumericEnumConverter_1_ToValue__0_System_Object_.md&amp;value=---%0Auid%3A%20IPA.Config.Stores.Converters.NumericEnumConverter%601.ToValue(%600%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>
  187. </span>
  188. <span class="small pull-right mobile-hide">
  189. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Config/Stores/Converters.cs/#L310">View Source</a>
  190. </span>
  191. <a id="IPA_Config_Stores_Converters_NumericEnumConverter_1_ToValue_" data-uid="IPA.Config.Stores.Converters.NumericEnumConverter`1.ToValue*"></a>
  192. <h4 id="IPA_Config_Stores_Converters_NumericEnumConverter_1_ToValue__0_System_Object_" data-uid="IPA.Config.Stores.Converters.NumericEnumConverter`1.ToValue(`0,System.Object)">ToValue(T, Object)</h4>
  193. <div class="markdown level1 summary"><p>Converts an enum of type <code data-dev-comment-type="typeparamref" class="typeparamref">T</code> to a <a class="xref" href="IPA.Config.Data.Value.html">Value</a> node corresponding to its value.</p>
  194. </div>
  195. <div class="markdown level1 conceptual"></div>
  196. <h5 class="decalaration">Declaration</h5>
  197. <div class="codewrapper">
  198. <pre><code class="lang-csharp hljs">public override Value ToValue(T obj, object parent)</code></pre>
  199. </div>
  200. <h5 class="parameters">Parameters</h5>
  201. <table class="table table-bordered table-striped table-condensed">
  202. <thead>
  203. <tr>
  204. <th>Type</th>
  205. <th>Name</th>
  206. <th>Description</th>
  207. </tr>
  208. </thead>
  209. <tbody>
  210. <tr>
  211. <td><span class="xref">T</span></td>
  212. <td><span class="parametername">obj</span></td>
  213. <td><p>the value to serialize</p>
  214. </td>
  215. </tr>
  216. <tr>
  217. <td><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></td>
  218. <td><span class="parametername">parent</span></td>
  219. <td><p>the object which owns <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  220. </td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. <h5 class="returns">Returns</h5>
  225. <table class="table table-bordered table-striped table-condensed">
  226. <thead>
  227. <tr>
  228. <th>Type</th>
  229. <th>Description</th>
  230. </tr>
  231. </thead>
  232. <tbody>
  233. <tr>
  234. <td><a class="xref" href="IPA.Config.Data.Value.html">Value</a></td>
  235. <td><p>an <a class="xref" href="IPA.Config.Data.Integer.html">Integer</a> node representing <code data-dev-comment-type="paramref" class="paramref">obj</code></p>
  236. </td>
  237. </tr>
  238. </tbody>
  239. </table>
  240. <h5 class="overrides">Overrides</h5>
  241. <div><span class="xref">IPA.Config.Stores.ValueConverter&lt;T&gt;.ToValue(T, System.Object)</span></div>
  242. <h3 id="implements">Implements</h3>
  243. <div>
  244. <a class="xref" href="IPA.Config.Stores.IValueConverter.html">IValueConverter</a>
  245. </div>
  246. <h3 id="extensionmethods">Extension Methods</h3>
  247. <div>
  248. <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>
  249. </div>
  250. <div>
  251. <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>
  252. </div>
  253. <div>
  254. <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>
  255. </div>
  256. <div>
  257. <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>
  258. </div>
  259. <div>
  260. <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>
  261. </div>
  262. </article>
  263. </div>
  264. <div class="hidden-sm col-md-2" role="complementary">
  265. <div class="sideaffix">
  266. <div class="contribution">
  267. <ul class="nav">
  268. <li>
  269. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/new/master/docs/override/new?filename=IPA_Config_Stores_Converters_NumericEnumConverter_1.md&amp;value=---%0Auid%3A%20IPA.Config.Stores.Converters.NumericEnumConverter%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" class="contribution-link">Improve this Doc</a>
  270. </li>
  271. <li>
  272. <a href="https://github.com/nike4613/BeatSaber-IPA-Reloaded/blob/0ba9d3c46d55d5ae58d8887ac27b303379298b53/IPA.Loader/Config/Stores/Converters.cs/#L290" class="contribution-link">View Source</a>
  273. </li>
  274. </ul>
  275. </div>
  276. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  277. <h5>In This Article</h5>
  278. <div></div>
  279. </nav>
  280. </div>
  281. </div>
  282. </div>
  283. </div>
  284. <footer>
  285. <div class="grad-bottom"></div>
  286. <div class="footer">
  287. <div class="container">
  288. <span class="pull-right">
  289. <a href="#top">Back to top</a>
  290. </span>
  291. <span>Generated by <strong>DocFX</strong></span>
  292. </div>
  293. </div>
  294. </footer>
  295. </div>
  296. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  297. <script type="text/javascript" src="../styles/docfx.js"></script>
  298. <script type="text/javascript" src="../styles/main.js"></script>
  299. </body>
  300. </html>