Re: Accessor Issue
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Apr 2005 12:03:04 -0400
Steven,
You would have to have each property on the Address class call the
MarkDirty method in order to specify that the property has changed.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Steven Wolf" <apoc69@xxxxxxx> wrote in message
news:652d8807.0504120749.5db3246d@xxxxxxxxxxxxxxxxxxxxx
> Hi guys,
>
> maybe you can help me again in developing my bussiness project for a
> company..
>
>
> i make sure, that each property of an entity, mark it self dirty when
> data get changed.. thats the code:
> private Address address;
>
> ....
>
> /// <summary>
> /// Set or return an address object
> /// </summary>
>
> class Facility : EntityObject
> {
>
> [EntityMemberAttribute]
> public Address Address
> {
> get { return this.address; }
> set { base.MarkDirty(); this.address = value; }
> }
>
>
> In this case, the address object i return here, has his own members,
> like: Street, Zip, City..
>
> So, i can access them easily by: someFacility.Address.City;
>
>
> the problem comes, when i try to change the city, for example:
>
> someFacility.Address.City = "New York";
>
>
> the facility class does'nt get dirty, because the someFacility.Address
> property use the get accessor in order to return the address, and the
> address itself use finaly the set-accessor..
>
>
> is there any possibility to fix that problem, instead creating a new
> address object and put that on the facility? (someFacility.Address =
> new Address(... )
>
>
> steven.
.
- Follow-Ups:
- Re: Accessor Issue
- From: Steven Wolf
- Re: Accessor Issue
- References:
- Accessor Issue
- From: Steven Wolf
- Accessor Issue
- Prev by Date: Re: Async Design Question
- Next by Date: Re: Command Line Arguments
- Previous by thread: Accessor Issue
- Next by thread: Re: Accessor Issue
- Index(es):
Relevant Pages
|