Article View: alt.pl.comp.lang.csharp
Article #10203Re: properties?
From: Karol
Date: Mon, 21 Nov 2005 09:44
Date: Mon, 21 Nov 2005 09:44
35 lines
1654 bytes
1654 bytes
Tomasz Muszyński napisał(a):
> ^KoWaL^ napisał(a):
>
>> Witam. Ucze sie dopiero c#, wiec prosze o wyrozumielosc:)
>> Czy ktos mi moze powiedziec do czego sluza properties np takie jak ta:
>>
>> public int Hour
>> {
>> get
>> {
>> return hour;
>> }
>> set
>> {
>> hour = value;
>> }
>> }
>
>
>
> Akurat to, to prawie do tego samego co:
> public int Hour;
>
> Ale jeśli chciałbyś jeszcze dorobić jakieś akcje następujące po zmianie
> wartości hour, np. zapamiętać godzinę w postaci sekund, wysłać event,
> odświeżyć GUI, itp. to nadają się do tego idealnie.
>
> tm
>
>
Plus jeszcze jedna wazna sprawa, kontrola poprawności danych.
Zapewnienie, że to co ustawiasz mieści się w zakresie dozwolonym.
Pozdrawiam
KArol
Technical Details
Message-ID:
<dls4nb$fpo$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mailReferences:
<dlr25p$i3n$1@inews.gazeta.pl> <dlr3i8$gve$1@atlantis.news.tpi.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail From: Karol <karol69@op.pl> Newsgroups: alt.pl.comp.lang.csharp Subject: Re: properties? Date: Mon, 21 Nov 2005 10:44:09 +0100 Organization: Onet.pl Lines: 35 Message-ID: <dls4nb$fpo$1@news.onet.pl> References: <dlr25p$i3n$1@inews.gazeta.pl> <dlr3i8$gve$1@atlantis.news.tpi.pl> NNTP-Posting-Host: 195.187.106.194 Mime-Version: 1.0 X-Trace: news.onet.pl 1132566060 16184 195.187.106.194 (21 Nov 2005 09:41:00 GMT) X-Complaints-To: usenet@news.onet.pl NNTP-Posting-Date: Mon, 21 Nov 2005 09:41:00 +0000 (UTC) X-Sender: aqTlAiv2oVys3ZPuUtr18w== In-Reply-To: <dlr3i8$gve$1@atlantis.news.tpi.pl> X-Accept-Language: pl, en-us, en User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit