• Tutorials
  • Api Documentation
  • Download
  • Credits
Show / Hide Table of Contents
  • AutoCheck.Core
    • Output
    • Output.Log
    • Output.Style
    • Output.Type
    • Script
    • Script.ExecutionMode
    • Utils
    • Utils.OS
  • AutoCheck.Core.Connectors
    • Atom
    • Base
    • Compressed
    • Css
    • Csv
    • CsvDocument
    • Dmoj
    • GDrive
    • Html
    • Math
    • Odoo
    • Operator
    • PlainText
    • PlainText.PlainTextDocument
    • Postgres
    • Rss
    • Shell
    • TextStream
    • Xml
    • Xml.XmlNodeType
  • AutoCheck.Core.CopyDetectors
    • Base
    • Base.Mode
    • Css
    • Html
    • PlainText
    • PlainText.File
    • SourceCode
    • SqlLog
    • Xml
  • AutoCheck.Core.Events
    • LogUpdateEventArgs
    • StatusUpdateEventArgs
    • StatusUpdateEventArgs.ExecutionEvent
  • AutoCheck.Core.Exceptions
    • ArgumentInvalidException
    • ArgumentNotFoundException
    • ConfigFileMissingException
    • ConnectionInvalidException
    • ConnectorInvalidException
    • ConnectorNotFoundException
    • DocumentInvalidException
    • DownloadFailedException
    • ItemNotFoundException
    • PorpertyNotFoundException
    • QueryInvalidException
    • RegexInvalidException
    • ResultMismatchException
    • ScriptInvalidException
    • ScriptNotFoundException
    • StyleInvalidException
    • StyleNotAppliedException
    • StyleNotFoundException
    • TableInconsistencyException
    • VariableInvalidException
    • VariableNotFoundException
  • Google.DiffMatchPatch
    • Diff
    • DiffMatchPatch
    • Operation
    • Patch

Class Utils

Inheritance
System.Object
Utils
Namespace: AutoCheck.Core
Assembly: AutoCheck.Core.dll
Syntax
public static class Utils : object

Properties

| Improve this Doc View Source

AppFolder

Returns the current app root folder

Declaration
public static string AppFolder { get; }
Property Value
Type Description
System.String

A folder's path.

| Improve this Doc View Source

ConfigFolder

Returns the current app config folder

Declaration
public static string ConfigFolder { get; }
Property Value
Type Description
System.String

A folder's path.

| Improve this Doc View Source

CurrentOS

Returns the current OS host type (Windows; Mac; GNU/Linux)

Declaration
public static Utils.OS CurrentOS { get; }
Property Value
Type Description
Utils.OS
| Improve this Doc View Source

ExecutionFolder

Returns the current app execution folder

Declaration
public static string ExecutionFolder { get; }
Property Value
Type Description
System.String

A folder's path.

| Improve this Doc View Source

ScriptsFolder

Returns the current app scripts folder

Declaration
public static string ScriptsFolder { get; }
Property Value
Type Description
System.String

A folder's path.

| Improve this Doc View Source

TempFolder

Returns the current app config folder

Declaration
public static string TempFolder { get; }
Property Value
Type Description
System.String

A folder's path.

| Improve this Doc View Source

UtilsFolder

Returns the current app utils folder

Declaration
public static string UtilsFolder { get; }
Property Value
Type Description
System.String

A folder's path.

Methods

| Improve this Doc View Source

ConfigFile(String)

Returns the requested app config file

Declaration
public static string ConfigFile(string file)
Parameters
Type Name Description
System.String file
Returns
Type Description
System.String

A file's path.

| Improve this Doc View Source

GetProductVersion(Assembly)

Returns the product version for the given assembly, which has been setup within the .csproj file.

Declaration
public static string GetProductVersion(Assembly assembly)
Parameters
Type Name Description
Assembly assembly

The assembly to use.

Returns
Type Description
System.String

The product version.

| Improve this Doc View Source

PathToCurrentOS(String)

Returns a path that uses the directory separators of the current OS.

Declaration
public static string PathToCurrentOS(string path)
Parameters
Type Name Description
System.String path
Returns
Type Description
System.String

A path.

| Improve this Doc View Source

PathToRemoteOS(String, Utils.OS)

Returns a path that uses the directory separators of the remote OS.

Declaration
public static string PathToRemoteOS(string path, Utils.OS remoteOS)
Parameters
Type Name Description
System.String path
Utils.OS remoteOS
Returns
Type Description
System.String

A path.

| Improve this Doc View Source

RemoveDiacritics(String)

Replaces the characters using diacritics with their equivalents without them (ñ->n; ü->u, etc.).

Declaration
public static string RemoveDiacritics(this string text)
Parameters
Type Name Description
System.String text

The original string.

Returns
Type Description
System.String

The replaced string.

| Improve this Doc View Source

RunWithRetry<T>(Action, Int32, Int32)

Runs the given action and retries it only for the given exception type (use Exception for generic behaviour).

Declaration
public static void RunWithRetry<T>(Action action, int max = 10, int wait = 250)
    where T : Exception
Parameters
Type Name Description
Action action

The action to run.

System.Int32 max

Max retries.

System.Int32 wait

Retry time will be exponential as step*wait.

Type Parameters
Name Description
T
| Improve this Doc View Source

RunWithRetry<R, T>(Func<R>, Int32, Int32)

Runs the given action and retries it only for the given exception type (use Exception for generic behaviour).

Declaration
public static R RunWithRetry<R, T>(Func<R> function, int max = 10, int wait = 250)
    where R : class where T : Exception
Parameters
Type Name Description
Func<R> function
System.Int32 max

Max retries.

System.Int32 wait

Retry time will be exponential as step*wait.

Returns
Type Description
R
Type Parameters
Name Description
R
T
| Improve this Doc View Source

ToCamelCase(String)

Converts the string to its camelcase convention.

Declaration
public static string ToCamelCase(this string text)
Parameters
Type Name Description
System.String text

The original input

Returns
Type Description
System.String
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX