C# Класс Catel.Data.ModelBaseExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

GetErrorMessage() публичный статический Метод

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.
Результат string

GetValidationContextForObjectGraph() публичный статический Метод

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.
Результат IValidationContext

GetWarningMessage() публичный статический Метод

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.
Результат string

Save() публичный статический Метод

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.
Результат void

Save() публичный статический Метод

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.
Результат void

SaveAsXml() публичный статический Метод

Saves as XML.
public static SaveAsXml ( this model, Stream stream ) : void
model this The model.
stream System.IO.Stream The stream.
Результат void

SaveAsXml() публичный статический Метод

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.
Результат void