Article View: alt.pl.comp.lang.csharp
Article #21499Re: Xml serialization
From: mk
Date: Wed, 19 May 2010 06:56
Date: Wed, 19 May 2010 06:56
22 lines
1477 bytes
1477 bytes
TheBest wrote:
> private double _volume;
>
> [XmlIgnore]
> public double Volume
> {
> get { return _volume; }
> set { _volume = value; }
> }
> [XmlElement("volume")]
> public string VolumeString
> {
> get { return Volume.ToString("#0.0"); }
> set { double.TryParse(value, out _volume); }
> }
Dzięki za odpowiedź. Myślałem, że da się to zrobić za pomocą atrybutów
lub w jakiś inny sposób, ale powyższy sposób też jest dobry.
Pozdrawiam
Mariusz
Technical Details
Message-ID:
<4bf38b91$0$2585$65785112@news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mailReferences:
<4bf2a07e$0$19160$65785112@news.neostrada.pl> <g7obc7-oaj.ln1@alfa.polanka.net.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail Date: Wed, 19 May 2010 08:56:16 +0200 From: mk <mk@nospam.com> User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 Newsgroups: alt.pl.comp.lang.csharp Subject: Re: Xml serialization References: <4bf2a07e$0$19160$65785112@news.neostrada.pl> <g7obc7-oaj.ln1@alfa.polanka.net.pl> In-Reply-To: <g7obc7-oaj.ln1@alfa.polanka.net.pl> Lines: 22 Message-ID: <4bf38b91$0$2585$65785112@news.neostrada.pl> Organization: Telekomunikacja Polska NNTP-Posting-Host: 79.189.213.122 X-Trace: 1274252177 unt-rea-a-02.news.neostrada.pl 2585 79.189.213.122:64950 X-Complaints-To: abuse@news.neostrada.pl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit