Bibliothèques d'outils pour le développement en C#

Aryx 2cf2b810d4 Documentation 7 months ago
AryxDevLibrary4.0 2cf2b810d4 Documentation 7 months ago
AryxDevViewLibrary 92429b7513 DateUtilsExt : 7 months ago
Properties ba490a7257 v1.0.1.656 1 year ago
constants e04cec1035 FileUtils : Nouvelle méthode (NewStreamWriterCstEncoding) pour instancier un SteamWriter avec un encodage précis (choix avec EnumOtherEncoding) 1 year ago
extensions 1654e8846d Documentation 7 months ago
utils 1654e8846d Documentation 7 months ago
AryxDevLibrary.csproj 2cf2b810d4 Documentation 7 months ago
AryxDevLibrary.csproj.user 3670df9dbd Ajout de 2 sous-projets : AryxDevLibrary4 qui contiendra des méthodes, basées sur le .net framework 4.0. AryxDevViewLibrary elle est une librairie qui contiendra des méthodes pour tout ce qui concerne les vues et les méthodes associées. 1 year ago
AryxDevLibrary.sln 3670df9dbd Ajout de 2 sous-projets : AryxDevLibrary4 qui contiendra des méthodes, basées sur le .net framework 4.0. AryxDevViewLibrary elle est une librairie qui contiendra des méthodes pour tout ce qui concerne les vues et les méthodes associées. 1 year ago
AryxDevLibrary.sln.DotSettings.user 0a80a7f36b XmlUtils : pour beaucoups de méthodes, ajout du paramêtre XmlNamespaceManager pour gérer des namespaces autre que celui par défaut. 9 months ago
AryxDevLibrary.v12.suo 1654e8846d Documentation 7 months ago
AssemblyTTempl.cs 92429b7513 DateUtilsExt : 7 months ago
AssemblyTTempl.tt 6aa6400b59 Diverses corrections 1 year ago
EnumUtils.cs ab1c37b6ba Ajout de la méthode FirstUpperOtherLower dans StringUtils et StringUtilsExt : permet de mettre en majuscule la première lettre d'un mot, et de mettre en minuscule le reste du mot. 1 year ago
README.md 2cf2b810d4 Documentation 7 months ago

README.md

#AryxDevLibrary Cette librairie contient un ensemble de classes utiles pour le développement de programmes C#. Documentation en anglais.

extensions.DateUtilsExt

Extensions methods for DateUtils object.

Methods

IsAfter(System.DateTime,System.DateTime)

Test if a DateTime object is After an other.

Parameters

date: the date to test is after

anotherDate: anotherDate

Return value

true if date is after anotehrDate. False if not, or equals

IsBefore(System.DateTime,System.DateTime)

Test if a DateTime object is before an other.

Parameters

date: the date to test is before

anotherDate: anotherDate

Return value

true if date is before anothe rDate. False if not, or equals

ChangeDate(System.DateTime,System.DateTime)

Return a new instance of DateTime, with date part (year, month, day) taken form another DateTime. Time preserved from original.

Parameters

dateTime: the input DateTime

newDate: the new DateTime to take date part

Return value

A new instance of DateTime, with date part (year, month, day)

ChangeTime(System.DateTime,System.Int32,System.Int32,System.Int32,System.Int32)

Change time part of a DateTime object.

Parameters

dateTime: input DateTime object

hours: new hour to set

minutes: new minute to set

seconds: new seconde to set

milliseconds: new millisecond to set

Return value

A new DateTime object, with time part changed

ChangeTime(System.DateTime,System.TimeSpan)

Change time part of a DateTime object.

Parameters

dateTime: input DateTime object

ts: the TimeSpan object to take time part

Return value

A new DateTime object, with time part changed

extensions.StringUtilsExt

Extension methods for the String class. Generaly refers to StringUtils.

Methods

SplitByStr(System.String,System.String)

Split a string by another string

Parameters

strToSplit: the string to split

splitStr: the string use to split

Return value

an array of strings splitted

FirstUpperOtherLower(System.String)

Capitalize the first letter and lower the others.

Parameters

str: this string

Return value

The string with the first letter upped and lowered the others

IsEmpty(System.String)

Test if the string is empty.

Parameters

value: this string

Return value

true if empty (lenght = 0 or ""), false or not.

Tronc(System.String,System.Int32)

Truncate the string.

Parameters

str: the string to truncate

limit: le lenght to truncate

Return value

Truncate(System.String,System.Int32)

Truncate the string.

Parameters

str: the string to truncate

limit: le lenght to truncate

Return value

Returns the truncated string, or the complete string if the limit is greater than or equal to the length of the input string.

ReplaceFirst(System.String,System.String,System.String)

Replace the first occurence of a substring in a string.

Parameters

str: The string in which to search

search: The substring to search for

replace: The replacement

Return value

The string with replacement done if exists.

RemoveDiacritics(System.String)

Remove diacritics acent in a string. Source : https://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net

Parameters

text: the string

Return value

the string without diacritics accents

Matches(System.String,System.String)

Tells whether or not this string matches the given regular expression.

Parameters

text: the input string to test

regex: the regular expression to which this string is to be matched

Return value

true if, and only if, this string matches the given regular expression

utils.ConsoleUtils.Reader

Fournit des méthodes pour avoir un Console.Readline avec timeout https://stackoverflow.com/a/18342182

Methods

ReadLine(System.Int32)

Affiche un readline avec timeout. Renvoie une exception, si le timeout est dépassé.

Parameters

timeOutMillisecs:

Return value

TryReadLine(System.String@,System.Int32)

Affiche un readline avec timeout. Renvoie false si le délai est dépassé; true et le texte dans la variable en out sinon.

Parameters

line:

timeOutMillisecs:

Return value

utils.ShortcutUtils

Note : when using this class, and using IWshShortcut interface in your project, you will have to use this reference "Interop.IWshRuntimeLibrary". To avoid compilation issues, make sure to set "False" for the property "Embed Interop Types" of the "Interop.IWshRuntimeLibrary" Reference in your project.

utils.StringUtils

Static method for Strings.

Fields

AUTH_FILENAME_CHARS

Characters allowed in a Windows filename.

Methods

SubstringsByLen(System.String,System.Int32)

Cuts a string, and n parts of delimited lengths.

Parameters

str: input string

len: lenght of string to cut

Return value

Array of strings

Split(System.String,System.String)

Split a string by another string

Parameters

strToSplit: the string to split

splitStr: the string use to split

Return value

an array of strings splitted

FirstUpperOtherLower(System.String)

Capitalize the first letter and lower the others.

Parameters

str: this string

Return value

The string with the first letter upped and lowered the others

Tronc(System.String,System.Int32)

Truncate the string.

Parameters

str: the string to truncate

limit: le lenght to truncate

Return value

The string with truncate

TroncRight(System.String,System.Int32,System.String)

Trunc a string from the right if string's lenght greater than defined lenght. A suffix can be use for indicate trunc.

Parameters

str: The string to truncate

maxLenght: The length from which to truncate

suffix: The suffix to indicate truncate. Default=""

Return value

The string with truncate

IsEmpty(System.String)

Test if a string is empty.

Parameters

str: the string to test

Return value

true if null, is empty (length = 0 or equals "")

Truncate(System.String,System.Int32)

Truncate the string with limit lenght

Parameters

str: the string to truncate

limit: le lenght to truncate

Return value

Returns the truncated string, or the complete string if the limit is greater than or equal to the length of the input string.

TruncRight(System.String,System.Int32,System.String)

Trunc a string from the right if string's lenght greater than defined lenght. A suffix can be use for indicate trunc.

Parameters

str: The string to truncate

maxLenght: The length from which to truncate

suffix: The suffix to indicate truncate. Default=""

Return value

The string with truncate

ReplaceFirst(System.String,System.String,System.String)

Replace the first occurence of a substring in a string.

Parameters

str: The string in which to search

search: The substring to search for

replace: The replacement

Return value

The string with replacement done if exists.

RemoveDiacritics(System.String)

Remove diacritics acent in a string. Source : https://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net

Parameters

text: the string

Return value

the string without diacritics accents

RemoveCharDifferentThan(System.String,System.String)

Removes characters in a string from a set of characters (placed in a string).

Parameters

str: The string in which to work

charList: the set of characters

Return value

IsNullOrWhiteSpace(System.String)

Check if a string is null, or contains only whitespaces. Same role that IsNullOrWhiteSpace(...) in .Net Framework 4

Parameters

str: The string to test

Return value

true if string is null, empty or contains only whitespace.

TextOrDefault(System.String,System.String,System.Boolean)

Returns a string if not null, or a default text if not.

Parameters

text: the text

defaut: default string

isTestEmpty:

Return value

Matches(System.String,System.String)

Tells whether or not this string matches the given regular expression.

Parameters

text: the input string to test

regex: the regular expression to which this string is to be matched

Return value

true if, and only if, this string matches the given regular expression

CsvStringContains(System.String,System.String,System.Char)

Tests if a string is contained in an array of elements, separated by a semicolon like a CSV line.

Parameters

toSearch: String to search

csvSepString: String where to search

sepChar: The separator. Semicolon by default

Return value

RandomString(System.Int32,System.String,System.Boolean)

Return a string with random char and with a defined lenght. Charset is customizable.

Parameters

length: Lenght of the string

charSet: The charset

ensureUnique: If true, ensures that the generated string has not already been generated previously. Use the ClearRandomStringCache() method to clean the string cache already generated.

Return value

ClearRandomStringCache

Cleans the cache of strings generated with the RandomString() method.

NumberToText(System.Int32)

Converts an integer into its textual form. The output is only in France-French.

Parameters

n: the integer to convert to

Return value

The textual form of integer. France-French only