C# Class Catel.Data.ModelBaseExtensions

Afficher le fichier Open project: Catel/Catel

Méthodes publiques

Méthode Description
GetErrorMessage ( this model, string userFriendlyObjectName = null ) : string

Returns a message that contains all the current errors.

GetValidationContextForObjectGraph ( this model ) : IValidationContext

Gets the validation context for a complete object graph by also checking the properties and recursive

GetWarningMessage ( this model, string userFriendlyObjectName = null ) : string

Returns a message that contains all the current warnings.

Save ( this model, Stream stream, ISerializer serializer ) : void

Saves the specified model to the stream using the serializer.

Save ( this model, string filePath, ISerializer serializer ) : void

Saves the specified model to the file using the specified serializer.

SaveAsXml ( this model, Stream stream ) : void

Saves as XML.

SaveAsXml ( this model, string filePath ) : void

Saves the specified model to the file as xml.

Private Methods

Méthode Description
AddModelValidation ( this validationContext, IModel model, List handledModels ) : void
GetListMessages ( IValidationContext validationContext, ValidationResultType validationResult ) : string

Gets the list messages.

This method is used to create a message string for field warnings or errors and business warnings or errors. Just pass the right dictionary and list to this method.

Method Details

GetErrorMessage() public static méthode

Returns a message that contains all the current errors.
The is null.
public static GetErrorMessage ( this model, string userFriendlyObjectName = null ) : string
model this The model base.
userFriendlyObjectName string Name of the user friendly object.
Résultat string

GetValidationContextForObjectGraph() public static méthode

Gets the validation context for a complete object graph by also checking the properties and recursive
The is null.
public static GetValidationContextForObjectGraph ( this model ) : IValidationContext
model this The model.
Résultat IValidationContext

GetWarningMessage() public static méthode

Returns a message that contains all the current warnings.
The is null.
public static GetWarningMessage ( this model, string userFriendlyObjectName = null ) : string
model this The model base.
userFriendlyObjectName string Name of the user friendly object.
Résultat string

Save() public static méthode

Saves the specified model to the stream using the serializer.
public static Save ( this model, Stream stream, ISerializer serializer ) : void
model this The model.
stream System.IO.Stream The stream.
serializer ISerializer The serializer.
Résultat void

Save() public static méthode

Saves the specified model to the file using the specified serializer.
public static Save ( this model, string filePath, ISerializer serializer ) : void
model this The model.
filePath string The file path.
serializer ISerializer The serializer.
Résultat void

SaveAsXml() public static méthode

Saves as XML.
public static SaveAsXml ( this model, Stream stream ) : void
model this The model.
stream System.IO.Stream The stream.
Résultat void

SaveAsXml() public static méthode

Saves the specified model to the file as xml.
public static SaveAsXml ( this model, string filePath ) : void
model this The model.
filePath string The file path.
Résultat void