Compare commits

..

3 commits

Author SHA1 Message Date
a30e502bc4 Calculation Helper 2024-04-22 21:27:51 -05:00
87bd044b31 Settings Helper + Documentation
The `SettingsHelper` is an agnostic way to access settings values uniformly through code. The accessor methods are controlled by the consumer.

Documentation has been a bit wonky. I changed the max number of version number components allowed, so each new build should not create new changes on every single bit of documentation now.
2024-04-22 18:28:21 -05:00
9f6debb1d9
Update README.md 2024-04-22 17:30:17 -05:00
164 changed files with 1702 additions and 351 deletions

View file

@ -78,8 +78,7 @@ namespace CapyKit
/// <summary> Emits an event with the given severity level, message, and method name. </summary>
/// <remarks>
/// In order to allow for efficient calling member access via <see cref="CallerMemberNameAttribute"/>
/// ,
/// it is suggested that <paramref name="args"/> is defined explicitly for formatted messages.
/// , it is suggested that <paramref name="args"/> is defined explicitly for formatted messages.
/// </remarks>
/// <param name="eventLevel"> The severity level of the event. </param>
/// <param name="message">
@ -93,8 +92,9 @@ namespace CapyKit
/// A variable-length parameters list containing arguments for formatting the message.
/// </param>
/// <example>
/// CapyEventReporter.EmitEvent(EventLevel.Error, "Could not find the description for {0}.",
/// args: new[] { enumeration });
/// <code>
/// CapyEventReporter.EmitEvent(EventLevel.Error, "Could not find the description for {0}.", args: new[] { enumeration });
/// </code>
/// </example>
/// <seealso cref="CallerMemberNameAttribute"/>
internal static void EmitEvent(EventLevel eventLevel, string message, [CallerMemberName] string method = null, params object[] args)

View file

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CapyKit.Enumerations
{
/// <summary>
/// An enumeration representing different measurement systems.
/// </summary>
public enum MeasurementSystem
{
/// <summary> The imperial measurement system. </summary>
Imperial = 0,
/// <summary> The metric measurement system. </summary>
Metric = 1
}
}

View file

@ -0,0 +1,160 @@
using CapyKit.Enumerations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace CapyKit.Helpers
{
/// <summary> Static class providing helper methods for various calculations. </summary>
public static class CalculationHelper
{
#region Members
/// <summary> The earth's radius in kilometers. </summary>
public const int EARTH_RADIUS_KILOMETERS = 6371;
/// <summary> Ratio of miles per kilometer . </summary>
public const double MILES_PER_KILOMETER = 0.621371;
/// <summary> The valid hexidecimal characters. </summary>
private const string chars = "0123456789ABCDEF";
#endregion Members
#region Methods
/// <summary>
/// Calculates the hash of a given string using an <see cref="MD5"/> value as the first 32 bits.
/// </summary>
/// <param name="str"> The string to be hashed. </param>
/// <returns> The calculated hash. </returns>
/// <remarks>
/// This method is used for a quick and consistent hash function. It should not be considered
/// cryptographically sound or used in security contexts.
/// </remarks>
public static int CalculateHash(string str)
{
MD5 md5Hasher = MD5.Create();
var md5Hash = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(str));
var hash = BitConverter.ToInt32(md5Hash, 0);
return hash;
}
/// <summary> Calculates the hexadecimal hash. </summary>
/// <param name="str"> The string to be hashed. </param>
/// <returns> The calculated 16 character hexadecimal hash. </returns>
public static string CalculateHexHash(string str)
{
byte[] bytes = Encoding.UTF8.GetBytes(str);
MD5 md5Hasher = MD5.Create();
byte[] hash = md5Hasher.ComputeHash(bytes);
char[] hash2 = new char[16];
// Note that here we are wasting bits of hash!
// But it isn't really important, because hash.Length == 32
for (int i = 0; i < hash2.Length; i++)
{
hash2[i] = CalculationHelper.chars[hash[i] % CalculationHelper.chars.Length];
}
return new string(hash2);
}
/// <summary>
/// Gets the distance between two points on earth using the <c>haversine</c> formula.
/// </summary>
/// <param name="latitudeOrigin"> The latitude origin. </param>
/// <param name="longitudeOrigin"> The longitude origin. </param>
/// <param name="latitudeDestination"> The latitude destination. </param>
/// <param name="longitudeDestination"> The longitude destination. </param>
/// <param name="measurementSystem"> (Optional) The measurement system. </param>
/// <returns> The distance. </returns>
/// <remarks>
/// Uses the <a href="https://www.movable-type.co.uk/scripts/latlong.html">haversine</a> formula
/// to calculate the "as-the-crow-flies" distance between two points on earth.
/// </remarks>
/// <seealso cref="GetDistance(double, double, double, double, MeasurementSystem)"/>
public static decimal GetDistance(decimal latitudeOrigin, decimal longitudeOrigin, decimal latitudeDestination, decimal longitudeDestination, MeasurementSystem measurementSystem = MeasurementSystem.Imperial)
{
double latitudeOriginalDouble = Convert.ToDouble(latitudeOrigin);
double longitudeOriginDouble = Convert.ToDouble(longitudeOrigin);
double latitudeDestinationDouble = Convert.ToDouble(latitudeDestination);
double longitudeDestinationDouble = Convert.ToDouble(longitudeDestination);
var result = GetDistance(latitudeOriginalDouble, longitudeOriginDouble, latitudeDestinationDouble, longitudeDestinationDouble, measurementSystem);
return Convert.ToDecimal(result);
}
/// <summary> Gets the distance between two points on earth using the <c>haversine</c> formula. </summary>
/// <param name="latitudeOrigin"> The latitude of the origin. </param>
/// <param name="longitudeOrigin"> The longitude of the origin. </param>
/// <param name="latitudeDestination"> The latitude destination. </param>
/// <param name="longitudeDestination"> The longitude destination. </param>
/// <param name="measurementSystem"> (Optional) The measurement system. </param>
/// <returns> The distance. </returns>
/// <remarks>
/// Uses the <a href="https://www.movable-type.co.uk/scripts/latlong.html">haversine</a> formula
/// to calculate the "as-the-crow-flies" distance between two points on earth.
/// </remarks>
public static double GetDistance(double latitudeOrigin, double longitudeOrigin, double latitudeDestination, double longitudeDestination, MeasurementSystem measurementSystem = MeasurementSystem.Imperial)
{
var thetaLatitude = DegreesToRadians(latitudeOrigin);
var thetaLongitude = DegreesToRadians(longitudeOrigin);
var deltaLatitude = DegreesToRadians(latitudeDestination - latitudeOrigin);
var deltaLongitude = DegreesToRadians(longitudeDestination - longitudeOrigin);
var haversineTheta = Math.Sin(deltaLatitude / 2) * Math.Sin(deltaLatitude / 2) + Math.Cos(thetaLatitude) * Math.Cos(thetaLongitude) * Math.Sin(deltaLongitude / 2) * Math.Sin(deltaLongitude / 2);
var angularDistance = 2 * Math.Atan2(Math.Sqrt(haversineTheta), Math.Sqrt(1 - haversineTheta));
var distance = EARTH_RADIUS_KILOMETERS * angularDistance;
if (measurementSystem == MeasurementSystem.Imperial)
{
return KilometersToMiles(distance);
}
return distance;
}
/// <summary> Converts kilometers to miles. </summary>
/// <param name="kilometers"> The value in kilometers. </param>
/// <returns> The value in miles. </returns>
public static double KilometersToMiles(double kilometers)
{
return kilometers * MILES_PER_KILOMETER;
}
/// <summary> Converts miles to kilometers. </summary>
/// <param name="miles"> The value in miles. </param>
/// <returns> The value in kilometers. </returns>
public static double MilesToKilometers(double miles)
{
return miles / MILES_PER_KILOMETER;
}
/// <summary> Convers degrees to radians. </summary>
/// <param name="degrees"> The degree value. </param>
/// <returns> The value as radians. </returns>
public static double DegreesToRadians(double degrees)
{
return degrees * Math.PI / 180.0;
}
/// <summary> Converts radians to degrees. </summary>
/// <param name="radians"> The radian value. </param>
/// <returns> The value as degrees. </returns>
public static double RadiansToDegrees(double radians)
{
return radians * 180.0 / Math.PI;
}
#endregion Methods
}
}

View file

@ -7,11 +7,18 @@ using System.Threading.Tasks;
namespace CapyKit.Helpers
{
/// <summary>
/// Helper class for handling text transformations.
/// </summary>
public class LanguageHelper
{
#region Methods
/// <summary> Converts camel case text to human readable text. </summary>
/// <remarks>
/// Camel case is a naming convention for identifiers in which the first letter of each word is
/// capitalized.
/// </remarks>
/// <param name="value"> The value. </param>
/// <returns> A string in human readable format. </returns>
public static string CamelCaseToHumanReadable(string value)

View file

@ -0,0 +1,136 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CapyKit.Helpers
{
/// <summary>
/// Static class containing helper methods for retrieving and setting application settings.
/// </summary>
/// <remarks>
/// The specific means of accessing and storing the settings are determined by the consumer,
/// allowing for flexibility in various environments such as <c>App.config</c> or <c>Web.config</c>
/// .
/// </remarks>
/// <example>
/// This example demonstrates how to set up the SettingsHelper class with custom accessor and
/// detector methods that read from an App.config file. The setup is done at the beginning of the
/// application execution, before any other usage of the helper methods.
/// <code>
/// public int main(string[] args)
/// {
/// // Set up SettingsHelper with custom accessor and detector methods
/// Func&lt;string, object&gt; accessor = (key) =&gt;
/// {
/// Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
/// return config.AppSettings.Settings[key].Value;
/// };
///
/// Func&lt;string, bool&gt; detector = (key) =&gt;
/// {
/// Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
/// return config.AppSettings.Settings.AllKeys.Contains(key);
/// };
///
/// SettingsHelper.SetAccessorMethod(accessor);
/// SettingsHelper.SetDetectorMethod(detector);
///
/// // Use the helper to retrieve and set settings
/// SettingsHelper.SetApplicationSetting&lt;int&gt;("MySettingKey", 42);
/// int newSetting = SettingsHelper.GetApplicationSetting&lt;int&gt;("MySettingKey");
/// Console.WriteLine("New setting: {0}", newSetting);
///
/// int mySetting = SettingsHelper.GetApplicationSetting&lt;int&gt;("MySettingKey");
/// Console.WriteLine("Retrieved setting: {0}", mySetting);
/// }
/// </code>
/// </example>
public static class SettingsHelper
{
#region Members
/// <summary>
/// Private delegate function that retrieves a setting with the given <c>key</c>. Returns the
/// setting as an uncast <see cref="object"/>.
/// </summary>
private static Func<string, object> accessor = (key) => default(object);
/// <summary>
/// Private delegate function that detects if a setting with a given <c>key</c> exists. Returns <see langword="true"/>
/// if the setting exists, <see langword="false"/> if not.
/// </summary>
private static Func<string, bool> detector = (key) => false;
#endregion Members
#region Methods
/// <summary>
/// Retrieves a setting with the given <c>key</c>. Returns the setting as an uncast <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T"> The type of the setting to be retrieved. </typeparam>
/// <param name="settingName"> The name of the setting to retrieve. </param>
/// <returns> The value of the setting as an uncast <typeparamref name="T"/>. </returns>
public static T GetApplicationSetting<T>(string settingName)
{
if (SettingsHelper.detector(settingName))
{
var result = Convert.ChangeType(SettingsHelper.accessor(settingName), typeof(T));
if (result is T)
{
return (T)result;
}
return default(T);
}
return default(T);
}
/// <summary> Sets the function used to retrieve application settings. </summary>
/// <exception cref="ArgumentNullException">
/// Thrown when one or more required arguments are null.
/// </exception>
/// <param name="accessor"> The new function used to retrieve application settings. </param>
public static void SetAccessorMethod(Func<string, object> accessor)
{
if (accessor != null)
{
SettingsHelper.accessor = accessor;
}
else
{
var error = "Cannot set the ApplicationSettingsHelper accessor method to a null function.";
CapyEventReporter.EmitEvent(EventLevel.Error, error);
throw new ArgumentNullException(error);
}
}
/// <summary>
/// Sets the function used to detect if an application setting with a given <c>key</c> exists.
/// </summary>
/// <exception cref="ArgumentNullException">
/// Thrown when one or more required arguments are null.
/// </exception>
/// <param name="detector">
/// The new function used to detect if an application setting exists.
/// </param>
public static void SetDetectorMethod(Func<string, bool> detector)
{
if (detector != null)
{
SettingsHelper.detector = detector;
}
else
{
var error = "Cannot set the ApplicationSettingsHelper detector method to a null function.";
CapyEventReporter.EmitEvent(EventLevel.Error, error);
throw new ArgumentNullException(error);
}
}
#endregion Methods
}
}

View file

@ -5,14 +5,4 @@
<HelpKeyword index="K" term="Welcome" />
</HelpKeywords>
</Topic>
<Topic id="7d36447b-0aab-4ce9-b5ed-e60ec5bee103" visible="True" title="Version History">
<HelpKeywords>
<HelpKeyword index="K" term="version, history" />
</HelpKeywords>
<Topic id="fa7407d1-9116-4ad7-a9ab-ed094685b070" visible="True" title="Version 1.0.0.0">
<HelpKeywords>
<HelpKeyword index="K" term="version, 1.0.0.0" />
</HelpKeywords>
</Topic>
</Topic>
</Topics>

View file

@ -23,7 +23,7 @@
<Language>en-US</Language>
<TransformComponentArguments>
<Argument Key="BibliographyDataFile" Value="True" />
<Argument Key="MaxVersionParts" Value="" />
<Argument Key="MaxVersionParts" Value="3" />
<Argument Key="IncludeEnumValues" Value="True" />
<Argument Key="EnumMemberSortOrder" Value="Value" />
<Argument Key="FlagsEnumValueFormat" Value="IntegerValue" />
@ -47,13 +47,14 @@
<HelpFileVersion>1.0.0.0</HelpFileVersion>
<NamingMethod>MemberName</NamingMethod>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<RootNamespaceContainer>False</RootNamespaceContainer>
<RootNamespaceContainer>True</RootNamespaceContainer>
<NamespaceGrouping>False</NamespaceGrouping>
<MaximumGroupParts>2</MaximumGroupParts>
<Preliminary>False</Preliminary>
<SdkLinkTarget>Blank</SdkLinkTarget>
<VisibleItems>Attributes, ExplicitInterfaceImplementations, InheritedMembers, InheritedFrameworkMembers, Internals, Privates, PrivateFields, Protected, SealedProtected, ProtectedInternalAsProtected, NonBrowsable</VisibleItems>
<PlugInConfigurations />
<VisibleItems>Attributes, ExplicitInterfaceImplementations, InheritedMembers, InheritedFrameworkMembers, Internals, Privates, PrivateFields, Protected, SealedProtected, ProtectedInternalAsProtected, NonBrowsable, InternalAndPrivateIfExternal</VisibleItems>
<PlugInConfigurations>
</PlugInConfigurations>
<ComponentConfigurations />
<WarnOnMissingSourceContext>False</WarnOnMissingSourceContext>
<HtmlSdkLinkType>Msdn</HtmlSdkLinkType>

View file

@ -1,17 +0,0 @@
# Version History
The topics in this section describe the various changes made to the [TODO: Project Title] over the life of the project.
## Version History
Select a version below to see a description of its changes.
<ul><li><p><a href="fa7407d1-9116-4ad7-a9ab-ed094685b070.md">Version 1.0.0.0</a></p></li><li><p>[TODO: Add links to each specific version page]</p></li></ul>
## See Also
#### Other Resources
<a href="849aa079-3d64-4cf1-966f-44af23c73160.md">CapyKit - C# Utilities</a>

View file

@ -24,4 +24,4 @@ See the **Conceptual Content** topics in the Sandcastle Help File Builder's help
#### Other Resources
<a href="7d36447b-0aab-4ce9-b5ed-e60ec5bee103.md">Version History</a>
[7d36447b-0aab-4ce9-b5ed-e60ec5bee103]

View file

@ -7,7 +7,7 @@ A hash set storing unique identifiers for events intended to only be emitted onc
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -0,0 +1,31 @@
# EARTH_RADIUS_KILOMETERS Field
The earth's radius in kilometers.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public const int EARTH_RADIUS_KILOMETERS = 6371
```
**F#**
``` F#
static val mutable EARTH_RADIUS_KILOMETERS: int
```
#### Field Value
<a href="https://learn.microsoft.com/dotnet/api/system.int32" target="_blank" rel="noopener noreferrer">Int32</a>
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,31 @@
# MILES_PER_KILOMETER Field
Ratio of miles per kilometer .
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public const double MILES_PER_KILOMETER = 0.621371
```
**F#**
``` F#
static val mutable MILES_PER_KILOMETER: float
```
#### Field Value
<a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a>
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,31 @@
# chars Field
The valid hexidecimal characters.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
private const string chars = "0123456789ABCDEF"
```
**F#**
``` F#
static val mutable private chars: string
```
#### Field Value
<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -7,7 +7,7 @@ A string of all the lower case characters.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ A string of all the numeric characters.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ A string of the most common non-alphanumeric characters.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ A string of all the upper case characters.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Default size of the generated salt.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -0,0 +1,31 @@
# accessor Field
Private delegate function that retrieves a setting with the given `key`. Returns the setting as an uncast <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
private static Func<string, Object> accessor
```
**F#**
``` F#
static val mutable private accessor: Func<string, Object>
```
#### Field Value
<a href="https://learn.microsoft.com/dotnet/api/system.func-2" target="_blank" rel="noopener noreferrer">Func</a>(<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,31 @@
# detector Field
Private delegate function that detects if a setting with a given `key` exists. Returns true if the setting exists, false if not.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
private static Func<string, bool> detector
```
**F#**
``` F#
static val mutable private detector: Func<string, bool>
```
#### Field Value
<a href="https://learn.microsoft.com/dotnet/api/system.func-2" target="_blank" rel="noopener noreferrer">Func</a>(<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>, <a href="https://learn.microsoft.com/dotnet/api/system.boolean" target="_blank" rel="noopener noreferrer">Boolean</a>)
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -7,7 +7,7 @@
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The default number of iterations.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The zero-based index of the pooled item.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The pooled item.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ A flag indicating whether the item is locked or not.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The name of the pooled item <a href="https://learn.microsoft.com/dotnet/api/syst
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The collection of pooled items.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The expression to retrieve the property.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -0,0 +1,24 @@
# CalculationHelper Fields
## Fields
<table>
<tr>
<td><a href="F_CapyKit_Helpers_CalculationHelper_chars.md">chars</a></td>
<td>The valid hexidecimal characters.</td></tr>
<tr>
<td><a href="F_CapyKit_Helpers_CalculationHelper_EARTH_RADIUS_KILOMETERS.md">EARTH_RADIUS_KILOMETERS</a></td>
<td>The earth's radius in kilometers.</td></tr>
<tr>
<td><a href="F_CapyKit_Helpers_CalculationHelper_MILES_PER_KILOMETER.md">MILES_PER_KILOMETER</a></td>
<td>Ratio of miles per kilometer .</td></tr>
</table>
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,21 @@
# SettingsHelper Fields
## Fields
<table>
<tr>
<td><a href="F_CapyKit_Helpers_SettingsHelper_accessor.md">accessor</a></td>
<td>Private delegate function that retrieves a setting with the given <code>key</code>. Returns the setting as an uncast <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>.</td></tr>
<tr>
<td><a href="F_CapyKit_Helpers_SettingsHelper_detector.md">detector</a></td>
<td>Private delegate function that detects if a setting with a given <code>key</code> exists. Returns true if the setting exists, false if not.</td></tr>
</table>
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -24,4 +24,4 @@ See the **Conceptual Content** topics in the Sandcastle Help File Builder's help
#### Other Resources
<a href="7d36447b-0aab-4ce9-b5ed-e60ec5bee103.md">Version History</a>
[7d36447b-0aab-4ce9-b5ed-e60ec5bee103]

View file

@ -7,7 +7,7 @@ Gets the value of the enumeration represented by this attribute.
## Definition
**Namespace:** <a href="N_CapyKit_Attributes.md">CapyKit.Attributes</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Initializes a new instance of the <a href="T_CapyKit_Attributes_EnumerationDescr
## Definition
**Namespace:** <a href="N_CapyKit_Attributes.md">CapyKit.Attributes</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Initializes a new instance of the CapyEventArgs class with the specified event l
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Emits an event with the given severity level, message, and method name.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
@ -40,7 +40,13 @@ internal static member EmitEvent :
In order to allow for efficient calling member access via <a href="https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.callermembernameattribute" target="_blank" rel="noopener noreferrer">CallerMemberNameAttribute</a> , it is suggested that *args* is defined explicitly for formatted messages.
## Example
**C#**
``` C#
CapyEventReporter.EmitEvent(EventLevel.Error, "Could not find the description for {0}.", args: new[] { enumeration });
```
## See Also

View file

@ -7,7 +7,7 @@ Emits an event with the given severity level, message, unique identifier, and me
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Subscribes the specified event handler to the event with the given subscription
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Unsubscribes the specified event handler from the event with the given origin.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Initializes the static fields of the <a href="T_CapyKit_CapyEventReporter.md">Ca
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ An <a href="https://learn.microsoft.com/dotnet/api/system.enum" target="_blank"
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ An <a href="https://learn.microsoft.com/dotnet/api/system.enum" target="_blank"
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ An <a href="https://learn.microsoft.com/dotnet/api/system.enum" target="_blank"
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ An <a href="https://learn.microsoft.com/dotnet/api/system.enum" target="_blank"
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ A *T* extension method that parses a string into an enumeration.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ A *T* extension method that parses a string into an enumeration.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Enumerates distinct items in this collection as defined by the key *property*.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Filters out items matching a *predicate* from the collection.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Filters out items matching a *predicate* from the collection.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ An IEnumable&lt;T&gt; extension method that left outer join.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ An IQueryable&lt;T&gt; extension method that left outer join.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ An IQueryable&lt;T&gt; extension method that left outer join.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The number of pages of *pageSize* size in the given collection.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ The number of pages of *pageSize* size in the given collection.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Get a page of items from a collection, skipping *pageNumber* pages of *pageSize*
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Get a page of items from a collection, skipping *pageNumber* pages of *pageSize*
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Replaces a null or empty string with a specified replacement string.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Replaces a null or whitespace string with a specified replacement string.
## Definition
**Namespace:** <a href="N_CapyKit_Extensions.md">CapyKit.Extensions</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -0,0 +1,41 @@
# CalculateHash Method
Calculates the hash of a given string using an <a href="https://learn.microsoft.com/dotnet/api/system.security.cryptography.md5" target="_blank" rel="noopener noreferrer">MD5</a> value as the first 32 bits.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static int CalculateHash(
string str
)
```
**F#**
``` F#
static member CalculateHash :
str : string -> int
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a></dt><dd>The string to be hashed.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.int32" target="_blank" rel="noopener noreferrer">Int32</a>
The calculated hash.
## Remarks
This method is used for a quick and consistent hash function. It should not be considered cryptographically sound or used in security contexts.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,38 @@
# CalculateHexHash Method
Calculates the hexadecimal hash.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static string CalculateHexHash(
string str
)
```
**F#**
``` F#
static member CalculateHexHash :
str : string -> string
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a></dt><dd>The string to be hashed.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>
The calculated 16 character hexadecimal hash.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,38 @@
# DegreesToRadians Method
Convers degrees to radians.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static double DegreesToRadians(
double degrees
)
```
**F#**
``` F#
static member DegreesToRadians :
degrees : float -> float
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The degree value.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a>
The value as radians.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,57 @@
# GetDistance(Decimal, Decimal, Decimal, Decimal, MeasurementSystem) Method
Gets the distance between two points on earth using the `haversine` formula.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static decimal GetDistance(
decimal latitudeOrigin,
decimal longitudeOrigin,
decimal latitudeDestination,
decimal longitudeDestination,
MeasurementSystem measurementSystem = MeasurementSystem.Imperial
)
```
**F#**
``` F#
static member GetDistance :
latitudeOrigin : decimal *
longitudeOrigin : decimal *
latitudeDestination : decimal *
longitudeDestination : decimal *
?measurementSystem : MeasurementSystem
(* Defaults:
let _measurementSystem = defaultArg measurementSystem MeasurementSystem.Imperial
*)
-> decimal
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.decimal" target="_blank" rel="noopener noreferrer">Decimal</a></dt><dd>The latitude origin.</dd><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.decimal" target="_blank" rel="noopener noreferrer">Decimal</a></dt><dd>The longitude origin.</dd><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.decimal" target="_blank" rel="noopener noreferrer">Decimal</a></dt><dd>The latitude destination.</dd><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.decimal" target="_blank" rel="noopener noreferrer">Decimal</a></dt><dd>The longitude destination.</dd><dt>  <a href="T_CapyKit_Enumerations_MeasurementSystem.md">MeasurementSystem</a>  (Optional)</dt><dd>(Optional) The measurement system.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.decimal" target="_blank" rel="noopener noreferrer">Decimal</a>
The distance.
## Remarks
Uses the <a href="https://www.movable-type.co.uk/scripts/latlong.html">
haversine</a> formula to calculate the "as-the-crow-flies" distance between two points on earth.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="Overload_CapyKit_Helpers_CalculationHelper_GetDistance.md">GetDistance Overload</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>
<a href="M_CapyKit_Helpers_CalculationHelper_GetDistance_1.md">GetDistance(Double, Double, Double, Double, MeasurementSystem)</a>

View file

@ -0,0 +1,56 @@
# GetDistance(Double, Double, Double, Double, MeasurementSystem) Method
Gets the distance between two points on earth using the `haversine` formula.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static double GetDistance(
double latitudeOrigin,
double longitudeOrigin,
double latitudeDestination,
double longitudeDestination,
MeasurementSystem measurementSystem = MeasurementSystem.Imperial
)
```
**F#**
``` F#
static member GetDistance :
latitudeOrigin : float *
longitudeOrigin : float *
latitudeDestination : float *
longitudeDestination : float *
?measurementSystem : MeasurementSystem
(* Defaults:
let _measurementSystem = defaultArg measurementSystem MeasurementSystem.Imperial
*)
-> float
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The latitude of the origin.</dd><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The longitude of the origin.</dd><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The latitude destination.</dd><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The longitude destination.</dd><dt>  <a href="T_CapyKit_Enumerations_MeasurementSystem.md">MeasurementSystem</a>  (Optional)</dt><dd>(Optional) The measurement system.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a>
The distance.
## Remarks
Uses the <a href="https://www.movable-type.co.uk/scripts/latlong.html">
haversine</a> formula to calculate the "as-the-crow-flies" distance between two points on earth.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="Overload_CapyKit_Helpers_CalculationHelper_GetDistance.md">GetDistance Overload</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,38 @@
# KilometersToMiles Method
Converts kilometers to miles.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static double KilometersToMiles(
double kilometers
)
```
**F#**
``` F#
static member KilometersToMiles :
kilometers : float -> float
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The value in kilometers.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a>
The value in miles.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,38 @@
# MilesToKilometers Method
Converts miles to kilometers.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static double MilesToKilometers(
double miles
)
```
**F#**
``` F#
static member MilesToKilometers :
miles : float -> float
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The value in miles.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a>
The value in kilometers.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,38 @@
# RadiansToDegrees Method
Converts radians to degrees.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static double RadiansToDegrees(
double radians
)
```
**F#**
``` F#
static member RadiansToDegrees :
radians : float -> float
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a></dt><dd>The radian value.</dd></dl>
#### Return Value
<a href="https://learn.microsoft.com/dotnet/api/system.double" target="_blank" rel="noopener noreferrer">Double</a>
The value as degrees.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_CalculationHelper.md">CalculationHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -7,7 +7,7 @@ Compresses a given object using the `gzip` algorithm.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Compresses a given object to a string using `base64` encoding of `gzip` format.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Decompresses the given `base64` string in `gzip` format.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Decompresses a given compressed `gzip` byte stream.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Decompresses a given `base64` encoded string of `gzip` format.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Converts camel case text to human readable text.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
@ -30,6 +30,9 @@ static member CamelCaseToHumanReadable :
<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>
A string in human readable format.
## Remarks
Camel case is a naming convention for identifiers in which the first letter of each word is capitalized.
## See Also

View file

@ -7,7 +7,7 @@ Initializes a new instance of the <a href="T_CapyKit_Helpers_LanguageHelper.md">
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Compares an unencrypted *providedPassword* with a stored, encrypted *existingPas
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Compares two session identifiers.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Compare two strings as case sensative.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Generates a new byte array of the specified length with random values.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Gets a cryptographically strong random password.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ A convenience method to generate a random string of the specified length using a
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Gets a cryptographically strong random string using the character values found i
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Hashes an unencrypted password.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Generates a new <a href="T_CapyKit_Password.md">Password</a> object using the PB
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Generates a new <a href="T_CapyKit_Password.md">Password</a> object using the PB
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Initializes a new instance of the <a href="T_CapyKit_Helpers_SecurityHelper.md">
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Deserializes an object to a given *T* type.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Deserializes an object to a given *T* type.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Deserializes a `JSON` encoded string to the given *T*.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Serializes an object to a byte array.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Serializes an object to a `JSON` encoded string.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -0,0 +1,42 @@
# GetApplicationSetting&lt;T&gt; Method
Retrieves a setting with the given `key`. Returns the setting as an uncast *T*.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static T GetApplicationSetting<T>(
string settingName
)
```
**F#**
``` F#
static member GetApplicationSetting :
settingName : string -> 'T
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a></dt><dd>The name of the setting to retrieve.</dd></dl>
#### Type Parameters
<dl><dt /><dd>The type of the setting to be retrieved.</dd></dl>
#### Return Value
T
The value of the setting as an uncast *T*.
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,41 @@
# SetAccessorMethod Method
Sets the function used to retrieve application settings.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static void SetAccessorMethod(
Func<string, Object> accessor
)
```
**F#**
``` F#
static member SetAccessorMethod :
accessor : Func<string, Object> -> unit
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.func-2" target="_blank" rel="noopener noreferrer">Func</a>(<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</dt><dd>The new function used to retrieve application settings.</dd></dl>
## Exceptions
<table>
<tr>
<td><a href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception" target="_blank" rel="noopener noreferrer">ArgumentNullException</a></td>
<td>Thrown when one or more required arguments are null.</td></tr>
</table>
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,41 @@
# SetDetectorMethod Method
Sets the function used to detect if an application setting with a given `key` exists.
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
public static void SetDetectorMethod(
Func<string, bool> detector
)
```
**F#**
``` F#
static member SetDetectorMethod :
detector : Func<string, bool> -> unit
```
#### Parameters
<dl><dt>  <a href="https://learn.microsoft.com/dotnet/api/system.func-2" target="_blank" rel="noopener noreferrer">Func</a>(<a href="https://learn.microsoft.com/dotnet/api/system.string" target="_blank" rel="noopener noreferrer">String</a>, <a href="https://learn.microsoft.com/dotnet/api/system.boolean" target="_blank" rel="noopener noreferrer">Boolean</a>)</dt><dd>The new function used to detect if an application setting exists.</dd></dl>
## Exceptions
<table>
<tr>
<td><a href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception" target="_blank" rel="noopener noreferrer">ArgumentNullException</a></td>
<td>Thrown when one or more required arguments are null.</td></tr>
</table>
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -0,0 +1,28 @@
# SettingsHelper Constructor
Initializes the static fields of the <a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper</a> class
## Definition
**Namespace:** <a href="N_CapyKit_Helpers.md">CapyKit.Helpers</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#
static SettingsHelper()
```
**F#**
``` F#
new : unit -> SettingsHelper
```
## See Also
#### Reference
<a href="T_CapyKit_Helpers_SettingsHelper.md">SettingsHelper Class</a>
<a href="N_CapyKit_Helpers.md">CapyKit.Helpers Namespace</a>

View file

@ -7,7 +7,7 @@ Compares the given plaintext password with an encrypted value using PBKDF2 algor
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Encrypts the given password using a defined algorithm.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Returns a string that represents the current object.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Initializes the static fields of the <a href="T_CapyKit_Password.md">Password</a
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

View file

@ -7,7 +7,7 @@ Constructor.
## Definition
**Namespace:** <a href="N_CapyKit.md">CapyKit</a>
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+735d7c4c91a8ae04c2d8cae4ce85ddf4909e5b7d
**Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0
**C#**
``` C#

Some files were not shown because too many files have changed in this diff Show more