// -- FILE ------------------------------------------------------------------ // name : CompanyModel.cs // project : Itenso Community // created : Jani Giannoudis - 2012.05.05 // language : c# // environment: .NET 4.0 // copyright : (c) 2004-2012 by Itenso GmbH, Switzerland // -------------------------------------------------------------------------- using System; namespace Itenso.Community.XamlPatterns.Program.Examples.OrderBrowser.ViewModel { // ------------------------------------------------------------------------ public class CompanyModel : OrderModelBase { // ---------------------------------------------------------------------- public CompanyModel( OrderModelBase parent ) : base( parent ) { LastModified = DateTime.Now; } // CompanyModel // ---------------------------------------------------------------------- public CompanyModel( string companyName, string address ) : this( null, companyName, address ) { } // CompanyModel // ---------------------------------------------------------------------- public CompanyModel( OrderModelBase parent, string companyName, string address ) : this( parent ) { CompanyName = companyName; Address = address; LastModified = DateTime.Now; } // CompanyModel // ---------------------------------------------------------------------- public override string TypeName { get { return "Company"; } } // TypeName // ---------------------------------------------------------------------- public string CompanyName { get { return companyName; } set { if ( value != companyName ) { companyName = value; NotifyPropertyChanged( "CompanyName" ); } } } // CompanyName // ---------------------------------------------------------------------- public string Address { get { return address; } set { if ( value != address ) { address = value; NotifyPropertyChanged( "Address" ); } } } // Address // ---------------------------------------------------------------------- public DateTime LastModified { get { return lastModified; } set { if ( value != lastModified ) { lastModified = value; NotifyPropertyChanged( "LastModified" ); } } } // LastModified // ---------------------------------------------------------------------- public override string ToString() { return CompanyName; } // ToString // ---------------------------------------------------------------------- protected override bool DoLoad() { Children.Add( new CustomerCollectionModel( this ) ); Children.Add( new OrderCollectionModel( this ) ); return true; } // DoLoad // ---------------------------------------------------------------------- // members private string companyName; private string address; private DateTime lastModified; } // class CompanyModel } // namespace Itenso.Community.XamlPatterns.Program.Examples.OrderBrowser.ViewModel // -- EOF -------------------------------------------------------------------
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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)