Otter SDK Reference
Version:

AH Class

Contains all-purpose helper methods.

Inheritance Hierarchy

  • object
    • Inedo.AH

Syntax

public class AH

Methods

Name Description
CoalesceString(string arg1, string arg2)

Returns the first non-null (Nothing in Visual Basic) and non-System.String.Empty expression among the specified arguments.

CoalesceString<T1, T2>(T1 arg1, T2 arg2)
CoalesceString(string[] args)

Returns the first non-null (Nothing in Visual Basic) and non-System.String.Empty expression among its arguments.

CreateSecureString(string s)

Converts the specified string to an instance of System.Security.SecureString.

Equals(byte[] array1, byte[] array2)

Returns a value indicating whether two byte arrays contain the same data.

Equals(System.Security.SecureString s1, string s2)

Returns a value indicating whether two strings contain the same value.

Equals(System.Security.SecureString s1, System.Security.SecureString s2)

Returns a value indicating whether two secure strings contain the same value.

ExtractZip(string zipFile, string targetDirectory)

Extracts a zip file to the specified directory.

ExtractZip(System.IO.Stream zipStream, string targetDirectory)

Extracts a zip file to the specified directory.

ExtractZip(string zipFile, string targetDirectory, System.Predicate<System.IO.Compression.ZipArchiveEntry> shouldExtract)

Extracts a zip file to the specified directory.

ExtractZip(System.IO.Stream zipStream, string targetDirectory, System.Predicate<System.IO.Compression.ZipArchiveEntry> shouldExtract)

Extracts a zip file to the specified directory.

FormatSize(long size)

Returns a string with a compact approximate formatted data size in bytes, KB, MB, or GB.

GetHashCode(byte[] array)

Returns a hash code for arbitrary binary data.

NullIf(object a, object b)

Returns a null (Nothing in Visual Basic) reference if the two specified parameters are equal (or if either are null (Nothing in Visual Basic) or DBNull.Value); otherwise, returns the first parameter.

NullIf(string a, string b)

Returns a null (Nothing in Visual Basic) reference if the two specified parameters are equal (or if either are null (Nothing in Visual Basic)); otherwise, returns the first parameter.

NullIf<T>(T? a, T? b)

Returns a null (Nothing in Visual Basic) reference if the two specified parameters are equal (or if either are null (Nothing in Visual Basic)); otherwise, returns the first parameter.

NullIf<T>(T a, T? b)

Returns a null (Nothing in Visual Basic) reference if the two specified parameters are equal (or if either are null (Nothing in Visual Basic)); otherwise, returns the first parameter.

ParseDate(string dateTimeString)

Converts the specified string representation of a date and time to its System.DateTime equivalent using System.DateTime.TryParse(System.String,System.DateTime@); if the string is not a valid date time, null (Nothing in Visual Basic) is returned.

ParseInt(string intString)

Converts the specified string representation of an integer to its System.Int32 equivalent using System.Int32.TryParse(System.String,System.Int32@). If the string is not a valid System.Int32, null is returned.

RelativeDate(System.DateTime? referenceFromDate, System.DateTime? toDate)

Calculates the relative time from the specified dates

Unprotect(System.Security.SecureString s)

Converts the specifed System.Security.SecureString into a string.