Show / Hide Table of Contents

Class CommonExtensions

Содержит общие и часто используемые методы расширения.

Inheritance
System.Object
CommonExtensions
Namespace:InfinniPlatform.Extensions
Assembly:InfinniPlatform.Core.dll
Syntax
public static class CommonExtensions : object

Methods

| Improve this Doc View Source

Contains(String, String, StringComparison)

Проверяет, содержится ли подстрока в строке.

Declaration
public static bool Contains(this string target, string value, StringComparison comparisonType)
Parameters
Type Name Description
System.String target
System.String value
StringComparison comparisonType
Returns
Type Description
System.Boolean
| Improve this Doc View Source

ExecuteSilent<T>(T, Action<T>)

Выполнить действие над объектом с подавлением возможных исключений.

Declaration
public static bool ExecuteSilent<T>(this T target, Action<T> action)
Parameters
Type Name Description
T target

Вызываемый объкт.

Action<T> action

Действие над объектом.

Returns
Type Description
System.Boolean

Возвращает true, если действие выполнено без ошибок; иначе false.

Type Parameters
Name Description
T

Тип объекта.

| Improve this Doc View Source

FindNextIndexOf(String, String, Int32, Boolean, Boolean)

Возвращает индекс первого вхождения подстроки в строку.

Declaration
public static int FindNextIndexOf(this string target, string value, int startIndex = 0, bool matchCase = false, bool wholeWord = false)
Parameters
Type Name Description
System.String target
System.String value
System.Int32 startIndex
System.Boolean matchCase
System.Boolean wholeWord
Returns
Type Description
System.Int32
| Improve this Doc View Source

FindPreviousIndexOf(String, String, Int32, Boolean, Boolean)

Возвращает индекс последнего вхождения подстроки в строку.

Declaration
public static int FindPreviousIndexOf(this string target, string value, int startIndex = 0, bool matchCase = false, bool wholeWord = false)
Parameters
Type Name Description
System.String target
System.String value
System.Int32 startIndex
System.Boolean matchCase
System.Boolean wholeWord
Returns
Type Description
System.Int32
| Improve this Doc View Source

Replace(String, String, String, Boolean, Boolean)

Заменяет в строке одну подстроку на другую.

Declaration
public static string Replace(this string target, string oldValue, string newValue, bool matchCase = false, bool wholeWord = false)
Parameters
Type Name Description
System.String target
System.String oldValue
System.String newValue
System.Boolean matchCase
System.Boolean wholeWord
Returns
Type Description
System.String
| Improve this Doc View Source

ToEnum<TEnum>(String, TEnum)

Преобразует строку в перечисление заданного типа.

Declaration
public static TEnum ToEnum<TEnum>(this string target, TEnum defaultValue = null)where TEnum : struct
Parameters
Type Name Description
System.String target
TEnum defaultValue
Returns
Type Description
TEnum
Type Parameters
Name Description
TEnum
| Improve this Doc View Source

ToFileSystemPath(String)

Заменяет прямую косую черту в строке на обратную косую черту.

Declaration
public static string ToFileSystemPath(this string s)
Parameters
Type Name Description
System.String s

Исходная строка.

Returns
Type Description
System.String
| Improve this Doc View Source

ToWebPath(String)

Заменяет обратную косую черту в строке на прямую косую черту.

Declaration
public static string ToWebPath(this string s)
Parameters
Type Name Description
System.String s

Исходная строка.

Returns
Type Description
System.String
  • Improve this Doc
  • View Source
Back to top © Copyright Infinnity Solutions Ltd, 2010–2017.