- XomegaFrameworkSamples.zip
- MyProject4
- MyProject4.Client.Objects
- MyProject4.Client.Web
- Gen
- MyProject4.Client.WPF
- MyProject4.Entities
- MyProject4.Model
- Framework
- base_types.xom
- operators.xom
- global_config.xom
- Import
- _types.xom
- aw_build_version.xom
- database_log.xom
- error_log.xom
- HumanResources
- department.xom
- employee.xom
- employee_address.xom
- employee_department_history.xom
- employee_pay_history.xom
- job_candidate.xom
- shift.xom
- Person
- address.xom
- address_type.xom
- contact.xom
- contact_type.xom
- country_region.xom
- state_province.xom
- Production
- bill_of_materials.xom
- culture.xom
- document.xom
- illustration.xom
- location.xom
- product.xom
- product_category.xom
- product_cost_history.xom
- product_description.xom
- product_document.xom
- product_inventory.xom
- product_list_price_history.xom
- product_model.xom
- product_model_illustration.xom
- product_model_product_description_culture.xom
- product_photo.xom
- product_product_photo.xom
- product_review.xom
- product_subcategory.xom
- scrap_reason.xom
- transaction_history.xom
- transaction_history_archive.xom
- unit_measure.xom
- work_order.xom
- work_order_routing.xom
- Purchasing
- product_vendor.xom
- purchase_order_detail.xom
- purchase_order_header.xom
- ship_method.xom
- vendor.xom
- vendor_address.xom
- vendor_contact.xom
- Sales
- contact_credit_card.xom
- country_region_currency.xom
- credit_card.xom
- currency.xom
- currency_rate.xom
- customer.xom
- customer_address.xom
- individual.xom
- sales_order_detail.xom
- sales_order_header.xom
- sales_person.xom
- sales_person_quota_history.xom
- sales_reason.xom
- sales_tax_rate.xom
- sales_territory.xom
- sales_territory_history.xom
- shopping_cart_item.xom
- special_offer.xom
- special_offer_product.xom
- store.xom
- store_contact.xom
- MyProject4.Model.xomproj
- MyProject4.Services
- Xomega.Fwk_src_1.3.zip
- Xomega.Framework
- xomega.fwk_src_1.3.zip
|
// Copyright (c) 2010-2012 Xomega.Net. All rights reserved.
using System.Runtime.Serialization;
namespace Xomega.Framework
{
/// <summary>
/// An error message that consists of an error code, a text message and the severity.
/// Error messages are typically added to an error list and can be serialized
/// to allow sending them in a service call.
/// </summary>
[DataContract]
public class ErrorMessage
{
/// <summary>
/// Default constructor to support deserialization.
/// </summary>
protected ErrorMessage() { }
/// <summary>
/// Constructs an error with a given error code and message.
/// </summary>
/// <param name="code">The error code.</param>
/// <param name="message">The error message.</param>
public ErrorMessage(string code, string message)
: this(code, message, ErrorSeverity.Error)
{
}
/// <summary>
/// Constructs an error message with a given code, message and severity.
/// </summary>
/// <param name="code">The error message code.</param>
/// <param name="message">The text message.</param>
/// <param name="sev">The error message severity.</param>
public ErrorMessage(string code, string message, ErrorSeverity sev)
{
this.Code = code;
this.Message = message;
this.Severity = sev;
}
/// <summary>
/// Error code, which is an error identifier.
/// </summary>
[DataMember]
public string Code { get; set; }
/// <summary>
/// Full error message text in the current language.
/// </summary>
[DataMember]
public string Message { get; set; }
/// <summary>
/// Error severity, which may affect the execution flow.
/// </summary>
[DataMember]
public ErrorSeverity Severity { get; set; }
}
/// <summary>
/// Error severity possible values.
/// </summary>
public enum ErrorSeverity
{
/// <summary>
/// A warning that may be displayed to the user for the confirmation before proceeding,
/// if supported by the current execution context.
/// </summary>
Warning,
/// <summary>
/// An error, that will be displayed to the user with the other errors. It doesn't stop
/// the execution flow, but prevents the operation from successfully completing.
/// </summary>
Error,
/// <summary>
/// A critical error, which stops the execution immediately and returns a fault to the user.
/// </summary>
Critical
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Xomega Team is striving to increase productivity and development quality by utilizing Model Driven Development coupled with Code Generation and the best design practices for application development.
We provide MDD tools, code generators and frameworks for Visual Studio and .Net development.
Visit us at
http://www.xomega.net