RandomCodeGenerator MembersKentico 8.0 API Reference
The RandomCodeGenerator type exposes the following members.
Constructors

  NameDescription
Public methodRandomCodeGenerator
Initializes new instance of RandomCodeGenerator generating random codes starting with prefix. Format of codes is specified by codePattern parameter.
Back to Top
Methods

  NameDescription
Protected methodCodeIsUnique
Checks if given code is unique - not generated yet and accepted by CodeChecker function.
Public methodOnlineEquals
Determines whether the specified OnlineObject is equal to the current OnlineObject.
(Inherited from OnlineObject.)
Protected methodOnlineFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from OnlineObject.)
Public methodGenerateCode
Generates one new unique code. Throws exception when not able to generate unique code within 10 attempts.
Public methodOnlineGetHashCode
Serves as a hash function for a particular type.
(Inherited from OnlineObject.)
Protected methodGetRandomDigit
Returns random digit 0-9.
Protected methodGetRandomChar
Returns random character A-Z.
Protected methodGetRandomNumber
Returns random number from 0 to max (exclusive).
Protected methodGetRandomSymbol
Returns random symbol 0-9 or A-Z.
Protected methodGetSymbolForType
Returns charType. Override this method to add custom character sets.
Public methodOnlineGetType
Gets the OnlineType of the current instance.
(Inherited from OnlineObject.)
Protected methodOnlineMemberwiseClone
Creates a shallow copy of the current OnlineObject.
(Inherited from OnlineObject.)
Protected methodRememberCode
Remembers given code as already generated.
Public methodOnlineToString
Returns a string that represents the current object.
(Inherited from OnlineObject.)
Protected methodTryGenerateCode
Generates one random code.
Back to Top
Extension Methods

  NameDescription
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Back to Top
Fields

  NameDescription
Protected fieldStatic memberdigits
Digits 0-9.
Protected fieldStatic memberchars
Characters A-Z.
Protected fieldpattern
Pattern of generated codes. It is set via constructor.
Protected fieldprefix
Prefix of codes. This string will be added at the beginning of all generated codes.
Protected fieldStatic membersymbols
Symbols A-Z and 0-9.
Back to Top
Properties

  NameDescription
Public propertyCodeChecker
Function returning true when its parameter represents acceptable code.
Back to Top
See Also