CapyKit/Docs/_site/api/CapyKit.Extensions.EnumerationExtensions.html

192 lines
9.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Class EnumerationExtensions | CapyKit Documentation </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content=" Class EnumerationExtensions | CapyKit Documentation ">
<link rel="icon" href="../favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
<meta name="docfx:navrel" content="../toc.html">
<meta name="docfx:tocrel" content="../toc.html">
<meta name="docfx:rel" content="../">
<meta name="loc:inThisArticle" content="In this article">
<meta name="loc:searchResultsCount" content="{count} results for &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<meta name="loc:tocFilter" content="Filter by title">
<meta name="loc:nextArticle" content="Next">
<meta name="loc:prevArticle" content="Previous">
<meta name="loc:themeLight" content="Light">
<meta name="loc:themeDark" content="Dark">
<meta name="loc:themeAuto" content="Auto">
<meta name="loc:changeTheme" content="Change theme">
<meta name="loc:copy" content="Copy">
<meta name="loc:downloadPdf" content="Download PDF">
<script type="module" src="./../public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
</head>
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="CapyKit Documentation">
CapyKit Documentation
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
</form>
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="content">
<div class="actionbar">
<nav id="breadcrumb"></nav>
</div>
<article data-uid="">
<h1 id="CapyKit_Extensions_EnumerationExtensions"> Class EnumerationExtensions</h1>
<p>Namespace: <a href="CapyKit.Extensions.html">CapyKit.Extensions</a><br>
Assembly: CapyKit.dll</p>
<p>Provides static extentions methods for providing additional functionality for <span class="xref">System.Enum</span> types.</p>
<pre><code class="lang-csharp">public static class EnumerationExtensions
</code></pre>
<h4 id="inheritance">Inheritance</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a>
<a href="CapyKit.Extensions.EnumerationExtensions.html">EnumerationExtensions</a></p>
<h4 id="inherited-members">Inherited Members</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>,
<a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a></p>
<h4 id="extension-methods">Extension Methods</h4>
<p><a href="CapyKit.Extensions.ObjectExtensions.html#CapyKit_Extensions_ObjectExtensions_UpdateProperties_System_Object_System_Object_">ObjectExtensions.UpdateProperties(object, object)</a></p>
<h2 id="methods">Methods</h2>
<h3 id="CapyKit_Extensions_EnumerationExtensions_GetDescription_System_Enum_"> GetDescription(Enum)</h3>
<p>An <span class="xref">System.Enum</span> extension method that gets a description.</p>
<pre><code class="lang-csharp">public static string GetDescription(this Enum enumeration)
</code></pre>
<h4 id="parameters">Parameters</h4>
<p><code>enumeration</code> <a href="https://learn.microsoft.com/dotnet/api/system.enum">Enum</a></p>
<p>The enumeration to act on.</p>
<h4 id="returns">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.string">string</a></p>
<p>The description if available, otherwise the string representation of the enumeration.</p>
<h3 id="CapyKit_Extensions_EnumerationExtensions_GetName_System_Enum_"> GetName(Enum)</h3>
<p>An <span class="xref">System.Enum</span> extension method that gets a name.</p>
<pre><code class="lang-csharp">public static string GetName(this Enum enumeration)
</code></pre>
<h4 id="parameters-1">Parameters</h4>
<p><code>enumeration</code> <a href="https://learn.microsoft.com/dotnet/api/system.enum">Enum</a></p>
<p>The enumeration to act on.</p>
<h4 id="returns-1">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.string">string</a></p>
<p>The name of the enumeration.</p>
<h3 id="CapyKit_Extensions_EnumerationExtensions_GetPrettyName_System_Enum_"> GetPrettyName(Enum)</h3>
<p>An <span class="xref">System.Enum</span> extension method that gets a human readable name.</p>
<pre><code class="lang-csharp">public static string GetPrettyName(this Enum enumeration)
</code></pre>
<h4 id="parameters-2">Parameters</h4>
<p><code>enumeration</code> <a href="https://learn.microsoft.com/dotnet/api/system.enum">Enum</a></p>
<p>The enumeration to act on.</p>
<h4 id="returns-2">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.string">string</a></p>
<p>The human readable name of the enumeration.</p>
<h3 id="CapyKit_Extensions_EnumerationExtensions_GetValue_System_Enum_"> GetValue(Enum)</h3>
<p>An <span class="xref">System.Enum</span> extension method that gets an integer value representing the enumation.</p>
<pre><code class="lang-csharp">public static int GetValue(this Enum enumeration)
</code></pre>
<h4 id="parameters-3">Parameters</h4>
<p><code>enumeration</code> <a href="https://learn.microsoft.com/dotnet/api/system.enum">Enum</a></p>
<p>The enumeration to act on.</p>
<h4 id="returns-3">Returns</h4>
<p><a href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></p>
<p>The integer value of the enumeration.</p>
<h3 id="CapyKit_Extensions_EnumerationExtensions_Parse__1___0_System_String_"> Parse&lt;T&gt;(T, string)</h3>
<p>A <code class="typeparamref">T</code> extension method that parses a string into an enumeration.</p>
<pre><code class="lang-csharp">public static T Parse&lt;T&gt;(this T enumeration, string value) where T : Enum
</code></pre>
<h4 id="parameters-4">Parameters</h4>
<p><code>enumeration</code> T</p>
<p>The enumeration to act on.</p>
<p><code>value</code> <a href="https://learn.microsoft.com/dotnet/api/system.string">string</a></p>
<p>The value.</p>
<h4 id="returns-4">Returns</h4>
<p>T</p>
<p>A T.</p>
<h4 id="type-parameters">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
<h3 id="CapyKit_Extensions_EnumerationExtensions_Parse__1___0_System_String_System_Boolean_"> Parse&lt;T&gt;(T, string, bool)</h3>
<p>A <code class="typeparamref">T</code> extension method that parses a string into an enumeration.</p>
<pre><code class="lang-csharp">public static T Parse&lt;T&gt;(this T enumeration, string value, bool ignoreCase) where T : Enum
</code></pre>
<h4 id="parameters-5">Parameters</h4>
<p><code>enumeration</code> T</p>
<p>The enumeration to act on.</p>
<p><code>value</code> <a href="https://learn.microsoft.com/dotnet/api/system.string">string</a></p>
<p>The string value of the <span class="xref">System.Enum</span>.</p>
<p><code>ignoreCase</code> <a href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></p>
<p>True to ignore case.</p>
<h4 id="returns-5">Returns</h4>
<p>T</p>
<p>A T.</p>
<h4 id="type-parameters-1">Type Parameters</h4>
<p><code>T</code></p>
<p>Generic type parameter.</p>
</article>
<div class="contribution d-print-none">
</div>
<div class="next-article d-print-none border-top" id="nextArticle"></div>
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
<div class="container-xxl search-results" id="search-results"></div>
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
</div>
</div>
</footer>
</body>
</html>