KeePass MSWifiPlugin
MSWifiImportPlugin.Data< T > Class Template Reference

An AbstractData for a simple value, e.g. string, bool, int. More...

Inherits MSWifiImportPlugin.AbstractData, and IXmlSerializable.

Inherited by MSWifiImportPlugin.WlanProfile, MSWifiImportPlugin.WlanProfile.IHV, MSWifiImportPlugin.WlanProfile.IHV.ConnectivityData, MSWifiImportPlugin.WlanProfile.IHV.IHVSecurityData, MSWifiImportPlugin.WlanProfile.IHV.OuiHeaderData, MSWifiImportPlugin.WlanProfile.MacRandData, MSWifiImportPlugin.WlanProfile.MSMData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.AuthEncryptionData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig.EAPConfigEAPData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig.EAPConfigEAPData.EAPConfigTypeData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig.EAPConfigEAPData.EAPConfigTypeData.EAPTypeEapData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig.EAPConfigEAPData.EAPConfigTypeData.EAPTypeEapData.EAPTypeEaptTypeData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig.EAPConfigEAPData.EAPConfigTypeData.PeapExtensionsData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig.EAPConfigEAPData.EAPConfigTypeData.PeapExtensionsData.PeapExtensionsV2Data, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.BaseEapMethodConfig.EAPConfigEAPData.EAPConfigTypeData.ServerValData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.EAPConfigData.EAPHostConfigData.EAPMethodeData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.OneXData.SingleSignOnData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.SharedKeyData, MSWifiImportPlugin.WlanProfile.SSIDConfigData, and MSWifiImportPlugin.WlanProfile.SSIDConfigData.SSIDData< T >.

Public Member Functions

delegate T DFctFromString (ProtectedString val)
 A Function translating a string (from a .xml-file or from a db entry) to the value More...
 
delegate ProtectedString DFctToString (T val, bool protect)
 A function translating the value to a string (to write it to a db entry) More...
 
delegate bool DValidString (ProtectedString val)
 Whether the given string can be translated to a valid data More...
 
delegate bool DValidValue (T val)
 Is the value of the data is valid More...
 
 Data (DFctFromString fromString, DFctToString toString, String eName, bool eIsMandory=false, DValidString isValidString=null, DValidValue isValid=null)
 Standard constructor More...
 
bool IsValidValue (T val)
 Whether a given value would be a valid one if this is set to it. More...
 
bool IsValidValueString (ProtectedString val)
 Whether a given string would give a valid value if this is set to it. More...
 
override void WriteXml (XmlWriter writer)
 Writes the data to a XML-file More...
 
override void ReadXml (XmlReader reader)
 Reads the data from a XML-file More...
 
override bool ExistsIn (PwDatabase db, PwEntry entry)
 Checks whether the data is contained in a given entry More...
 
override bool SaveIn (PwDatabase db, PwEntry entry)
 Writes a data to a given enty in a database More...
 
override bool LoadFrom (PwDatabase db, PwEntry entry)
 Reads a data from a given enty in a database More...
 
override void ClearIn (PwDatabase db, PwEntry entry)
 Deletes the data from a given enty in a database More...
 
override void Clear ()
 Clears the data More...
 
XmlSchema GetSchema ()
 
void WriteXml (XmlWriter writer)
 Writes the data to a XML-file More...
 
void ReadXml (XmlReader reader)
 Reads the data from a XML-file More...
 
bool SaveIn (PwDatabase db, PwEntry entry)
 Saves the data in an entry in a database More...
 
bool LoadFrom (PwDatabase db, PwEntry entry)
 Reads the data from an entry in a database More...
 
void ClearIn (PwDatabase db, PwEntry entry)
 Delete the data from an entry in a database More...
 
void Clear ()
 Deletes the content saved in the data More...
 
- Public Member Functions inherited from MSWifiImportPlugin.AbstractData
XmlSchema GetSchema ()
 Always null More...
 

Protected Attributes

bool LastInputValid = false
 Whether the value was valid after setting/reading it the last time. More...
 

Properties

DFctFromString FctFromString [get, set]
 The FctFromString for the given data More...
 
DFctToString FctToString [get, set]
 The FctToString for the given data More...
 
DValidString FctIsValidString [get, set]
 The ValidString for the given data More...
 
DValidValue FctIsValid [get, set]
 The ValidValue for the given data More...
 
Value [get, set]
 The value saved in the data More...
 
override bool IsValid [get]
 
override bool WriteNecessary [get]
 
virtual bool IsValid [get]
 The data is valid if all mandory subentries are valid More...
 
- Properties inherited from MSWifiImportPlugin.AbstractData
bool IsMandory [get, set]
 If this is true and this is invalid, then its parent is invalid, too. More...
 
String EntryName [get, set]
 Name of the value in the database More...
 
abstract bool WriteNecessary [get]
 Whether the value must be written in the XML-file, i.e. its valid but not empty. More...
 
abstract bool IsValid [get]
 Whether the data is valid, i.e. all mandory subentries have to valid. More...
 

Private Member Functions

bool FromString (ProtectedString str)
 Sets the value from a given string More...
 

Private Attributes

_value
 

Additional Inherited Members

- Protected Member Functions inherited from MSWifiImportPlugin.AbstractData
 AbstractData (String eName, bool eIsMandory)
 Standard constructor More...
 

Detailed Description

An AbstractData for a simple value, e.g. string, bool, int.

A complex type. When the data is written to/read from a .xml-file or a database entry, then each of its properties (if it is of a subclass of AbstractData) will be written/read correspondingly (and the result of the process is calculated by the process of its properties).

Template Parameters
TWhat is saved in the Data
Type Constraints
T :new() 

Constructor & Destructor Documentation

◆ Data()

MSWifiImportPlugin.Data< T >.Data ( DFctFromString  fromString,
DFctToString  toString,
String  eName,
bool  eIsMandory = false,
DValidString  isValidString = null,
DValidValue  isValid = null 
)

Standard constructor

Parameters
fromStringDFctFromString
toStringDFctToString
eNameThe name in the database entry
eIsMandoryWhether the data is valid
isValidStringDFctIsValidString
isValidDFctIsValid

Member Function Documentation

◆ Clear() [1/2]

void MSWifiImportPlugin.Data< T >.Clear ( )
virtual

Deletes the content saved in the data

Implements MSWifiImportPlugin.AbstractData.

◆ Clear() [2/2]

override void MSWifiImportPlugin.Data< T >.Clear ( )
virtual

Clears the data

Implements MSWifiImportPlugin.AbstractData.

◆ ClearIn() [1/2]

void MSWifiImportPlugin.Data< T >.ClearIn ( PwDatabase  db,
PwEntry  entry 
)
virtual

Delete the data from an entry in a database

Parameters
dbThe database in which the entry lies
entryThe entry from which the data will be erased

Implements MSWifiImportPlugin.AbstractData.

◆ ClearIn() [2/2]

override void MSWifiImportPlugin.Data< T >.ClearIn ( PwDatabase  db,
PwEntry  entry 
)
virtual

Deletes the data from a given enty in a database

Parameters
dbThe database in which the entry is safed
entryThe entry from which the data will be removed.

Implements MSWifiImportPlugin.AbstractData.

◆ DFctFromString()

delegate T MSWifiImportPlugin.Data< T >.DFctFromString ( ProtectedString  val)

A Function translating a string (from a .xml-file or from a db entry) to the value

Parameters
valThe string to be translated
Returns
The translated value

◆ DFctToString()

delegate ProtectedString MSWifiImportPlugin.Data< T >.DFctToString ( val,
bool  protect 
)

A function translating the value to a string (to write it to a db entry)

Parameters
valThe value to be translated
protectWhether the translated value has to be encrypted.
Returns
The translated value

◆ DValidString()

delegate bool MSWifiImportPlugin.Data< T >.DValidString ( ProtectedString  val)

Whether the given string can be translated to a valid data

Parameters
valThe string to be translated
Returns
Whether the string can be translated

◆ DValidValue()

delegate bool MSWifiImportPlugin.Data< T >.DValidValue ( val)

Is the value of the data is valid

Parameters
valThe value to be checked
Returns
Whether the value is valid

◆ ExistsIn()

override bool MSWifiImportPlugin.Data< T >.ExistsIn ( PwDatabase  db,
PwEntry  entry 
)
virtual

Checks whether the data is contained in a given entry

Parameters
dbThe database in which the entry is safed
entryThe entry in which the data is (or isn't) safed.
Returns
Whether the data is contained in a given entry.

Implements MSWifiImportPlugin.AbstractData.

Reimplemented in MSWifiImportPlugin.WlanProfile.MSMData.SecurityData.AuthEncryptionData, MSWifiImportPlugin.WlanProfile.MSMData.SecurityData, MSWifiImportPlugin.WlanProfile.MSMData, MSWifiImportPlugin.WlanProfile.SSIDConfigData.SSIDData< T >, and MSWifiImportPlugin.WlanProfile.SSIDConfigData.

◆ FromString()

bool MSWifiImportPlugin.Data< T >.FromString ( ProtectedString  str)
private

Sets the value from a given string

Parameters
strThe value as string

<return>Whether a valid value was set.</return> Note that if a non-valid string is given, then value is cleared

◆ IsValidValue()

bool MSWifiImportPlugin.Data< T >.IsValidValue ( val)

Whether a given value would be a valid one if this is set to it.

Parameters
valThe value to be checked.
Returns
Whether the value is a valid one.

◆ IsValidValueString()

bool MSWifiImportPlugin.Data< T >.IsValidValueString ( ProtectedString  val)

Whether a given string would give a valid value if this is set to it.

Parameters
valThe value to be checked.
Returns
Whether the value is a valid one.

◆ LoadFrom() [1/2]

bool MSWifiImportPlugin.Data< T >.LoadFrom ( PwDatabase  db,
PwEntry  entry 
)
virtual

Reads the data from an entry in a database

Parameters
dbThe database in which the entry lies
entryThe entry from which the data will be read
Returns
Whether the read process was successfull, i.e. a valid element was read.

Note that invalid read data will always be cleared.

Implements MSWifiImportPlugin.AbstractData.

◆ LoadFrom() [2/2]

override bool MSWifiImportPlugin.Data< T >.LoadFrom ( PwDatabase  db,
PwEntry  entry 
)
virtual

Reads a data from a given enty in a database

Parameters
dbThe database in which the entry is safed
entryThe entry in which the data was saved.
Returns
Whether the data is successfully loaded.

Implements MSWifiImportPlugin.AbstractData.

◆ ReadXml() [1/2]

void MSWifiImportPlugin.Data< T >.ReadXml ( XmlReader  reader)
virtual

Reads the data from a XML-file

Parameters
writerThe corresponding reader

Implements MSWifiImportPlugin.AbstractData.

◆ ReadXml() [2/2]

override void MSWifiImportPlugin.Data< T >.ReadXml ( XmlReader  reader)
virtual

Reads the data from a XML-file

Parameters
writerThe corresponding reader

Implements MSWifiImportPlugin.AbstractData.

◆ SaveIn() [1/2]

bool MSWifiImportPlugin.Data< T >.SaveIn ( PwDatabase  db,
PwEntry  entry 
)
virtual

Saves the data in an entry in a database

Parameters
dbThe database in which the entry lies
entryThe entry in which the data wil be written
Returns
Whether the write process was successfull.

Note that all data in entry will be removed or replaced!

Note that an invalid value will never be successfull written to the db.

Implements MSWifiImportPlugin.AbstractData.

◆ SaveIn() [2/2]

override bool MSWifiImportPlugin.Data< T >.SaveIn ( PwDatabase  db,
PwEntry  entry 
)
virtual

Writes a data to a given enty in a database

Parameters
dbThe database in which the entry is safed
entryThe entry in which the data will be safed.
Returns
Whether the data is successfully saved.

Implements MSWifiImportPlugin.AbstractData.

◆ WriteXml() [1/2]

void MSWifiImportPlugin.Data< T >.WriteXml ( XmlWriter  writer)
virtual

Writes the data to a XML-file

Parameters
writerThe corresponding writer

Implements MSWifiImportPlugin.AbstractData.

◆ WriteXml() [2/2]

override void MSWifiImportPlugin.Data< T >.WriteXml ( XmlWriter  writer)
virtual

Writes the data to a XML-file

Parameters
writerThe corresponding writer

Implements MSWifiImportPlugin.AbstractData.

Member Data Documentation

◆ LastInputValid

bool MSWifiImportPlugin.Data< T >.LastInputValid = false
protected

Whether the value was valid after setting/reading it the last time.

Property Documentation

◆ FctFromString

DFctFromString MSWifiImportPlugin.Data< T >.FctFromString
getset

The FctFromString for the given data

◆ FctIsValid

DValidValue MSWifiImportPlugin.Data< T >.FctIsValid
getset

The ValidValue for the given data

◆ FctIsValidString

DValidString MSWifiImportPlugin.Data< T >.FctIsValidString
getset

The ValidString for the given data

◆ FctToString

DFctToString MSWifiImportPlugin.Data< T >.FctToString
getset

The FctToString for the given data

◆ IsValid

virtual bool MSWifiImportPlugin.Data< T >.IsValid
get

The data is valid if all mandory subentries are valid

Returns
Whether the data is valid

◆ Value

T MSWifiImportPlugin.Data< T >.Value
getset

The value saved in the data

Note that the setting function also resets 'isValid'.


The documentation for this class was generated from the following files: