Wanzyee Studio
CryptoPeriodabstract

Wrapper to encrypt and store a System.TimeSpan. More...

Inherits CryptoCache< TimeSpan, TimeSpanField >.

Public Member Functions

 CryptoPeriod (TimeSpan value=default)
 Initialize with the specified value. More...
 
override string ToString ()
 Return the time span text. More...
 
CryptoCache(T value=default) override void OnBeforeSerialize ()
 Initialize with the specified value. More...
 
override void OnAfterDeserialize ()
 OnAfterDeserialize, read the real value to the obfuscated cache. More...
 

Protected Member Functions

override TimeSpan ToValue (string text)
 Convert the decrypted text to the real value. More...
 
override string ToText (TimeSpan value)
 Convert the real value to the text to encrypt. More...
 
override TimeSpanField ReadEditee ()
 Read the stored value to the editee value. More...
 
override void WriteEditee (TimeSpanField editee)
 Write the editee value to the stored value. More...
 
override TimeSpan ReadObfuscated ()
 Read the obfuscated cache value. More...
 
override void WriteObfuscated (TimeSpan value)
 Write value to the obfuscated cache. More...
 
abstract void WriteObfuscated (T value)
 Write value to the obfuscated cache. More...
 
int RandomValue (int min=int.MinValue, int max=int.MaxValue)
 Get a random value in the specified range. More...
 

Properties

override T value [get, set]
 The stored value. More...
 

Detailed Description

Wrapper to encrypt and store a System.TimeSpan.

Constructor & Destructor Documentation

CryptoPeriod ( TimeSpan  value = default)

Initialize with the specified value.

Parameters
valueValue.

Member Function Documentation

override string ToString ( )

Return the time span text.

Returns
A string represents this.
override TimeSpan ToValue ( string  text)
protected

Convert the decrypted text to the real value.

Parameters
textText.
Returns
Value.
override string ToText ( TimeSpan  value)
protected

Convert the real value to the text to encrypt.

Parameters
valueValue.
Returns
Text.
override TimeSpanField ReadEditee ( )
protected

Read the stored value to the editee value.

Returns
Editee.
override void WriteEditee ( TimeSpanField  editee)
protected

Write the editee value to the stored value.

Parameters
editeeEditee.
override TimeSpan ReadObfuscated ( )
protectedvirtual

Read the obfuscated cache value.

Returns
Value.

Implements CryptoCache< TimeSpan, TimeSpanField >.

override void WriteObfuscated ( TimeSpan  value)
protected

Write value to the obfuscated cache.

Parameters
valueValue.
CryptoCache (T value = default) override void OnBeforeSerialize ( )
inherited

Initialize with the specified value.

Parameters
valueValue.

OnBeforeSerialize, write the obfuscated cache to the real value.

override void OnAfterDeserialize ( )
inherited

OnAfterDeserialize, read the real value to the obfuscated cache.

abstract void WriteObfuscated ( value)
protectedpure virtualinherited

Write value to the obfuscated cache.

Parameters
valueValue.
int RandomValue ( int  min = int.MinValue,
int  max = int.MaxValue 
)
protectedinherited

Get a random value in the specified range.

Parameters
minMin value.
maxMax value.
Returns
Value.

Property Documentation

override T value
getsetinherited

The stored value.