Click or drag to resize

Guard Class

[This is preliminary documentation and is subject to change.]

Provides guard methods that can be used for various checks
Inheritance Hierarchy
SystemObject
  CSInfrastructure.CodeContractsGuard

Namespace:  CSInfrastructure.CodeContracts
Assembly:  CSInfrastructure (in CSInfrastructure.dll) Version: 1.13.0+Branch.master.Sha.d583fc64569355d188a9c0818d257b6d0d3e1339
Syntax
C#
public static class Guard

The Guard type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAreNotSameT
Checks if object1 is not the same as object2
Public methodStatic memberAreSameT
Checks if object1 is the same as object2
Public methodStatic memberHasAtLeastNElementsT(IEnumerableT, Int32, String, String)
Checks if items has at least count number of items in its collection
Public methodStatic memberHasAtLeastNElementsT(IReadOnlyListT, Int32, String, String)
Checks if items has at least count number of items in its collection
Public methodStatic memberHasExactlyNElementsT
Checks if items has exactly count number of items in its collection
Public methodStatic memberHasNElementsInRangeT
Checks if items has at least minimum and at most maximum number of items.
Public methodStatic memberIsAssignableToTAssigner
Checks if type inherits from TAssigner
Public methodStatic memberIsCollectionType
Checks if t is a collection type
Public methodStatic memberIsDefinedT(T, String)
Checks if enumValue is defined on the enum type
Public methodStatic memberIsDefinedT(T, String, T)
Checks if enumValue is defined on T and is defined in allowedValues
Public methodStatic memberIsEnum
Checks if param is an enum.
Public methodStatic memberIsExistingDirectory
Checks if folder exists on disk
Public methodStatic memberIsExistingFile
Checks if fileFullPath exists on disk
Public methodStatic memberIsGreaterThan
Checks if value is greater than minimum
Public methodStatic memberIsInRangeT
Checks if the value falls within min and max inclusive
Public methodStatic memberIsLargerThanOtherArgument
Checks if original is larger then other
Public methodStatic memberIsNaturalNumber(Int32, String)
Checks if value is a natural number
Public methodStatic memberIsNaturalNumber(Int64, String)
Checks if value is a natural number
Public methodStatic memberIsNotEmpty
Checks if guid is not an empty guid
Public methodStatic memberIsNotNullT
Checks if param is not NULL.
Public methodStatic memberIsNotNullOrWhiteSpace
Checks if stringValue is not NULL or whitespace
Public methodStatic memberIsOfType(Type, Object, String)
Checks if item is of type t
Public methodStatic memberIsOfTypeT(Object, String)
Checks if item is of type T
Public methodStatic memberIsReadable
Checks if stream is read-able
Public methodStatic memberIsTrueTex
Public methodStatic memberIsValidPointer
Checks if pointer is not a zero pointer
Public methodStatic memberIsWritable
Checks if stream is write-able
Public methodStatic memberStringStartsWith
Checks if value starts with startsWith
Top
See Also