473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

xmlignore attribute

I have a base class which contains one public virtual property. I derived this class and overrided that property with xmlignore tag is added. when i try to xmlserialize, it is not ignored by xmlserializer. how can i achieve this.
Mar 5 '07 #1
1 2640
kenobewan
4,871 Expert 4TB
Here is an example that may help:
Expand|Select|Wrap|Line Numbers
  1. public class Test
  2. {
  3.   private int aNumber = 10;
  4.  
  5.   [XmlIgnore]
  6.   public int ANumber
  7.   {
  8.       get { return aNumber; }
  9.       set { aNumber = value; }
  10.   }
  11.  
  12.   [XmlElement("ANumber")]
  13.   public object XmlANumber
  14.   {
  15.       get { return aNumber; }
  16.       set { aNumber = (int)value; }
  17.   }
  18. }
Mar 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: j erickson | last post by:
with the following xsl and xml file, the display of the gif file with the <image/url> tag works. However, the gif file in the <description> tag using the name attribute "src" won't make the correct...
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
2
by: Robert W. | last post by:
A while back I posted this:...
1
by: nickdu | last post by:
By the way, I also posted this on DotNet Framework General. I'm trying to serialize, via the XmlSerializer, an object which is derived from System.Windows.Forms.Control. It throws an exception...
2
by: gary.goodwin | last post by:
HI I am trying to understand Attribute usage. For example the class SerializableAttribute is a class correct? So why when it is actually u sed the "Attribute" portion of the name is dropped. The...
1
by: Undergrid | last post by:
I have a pretty complex data structure which I want to serialize to and from XML, I have tried the .net 2.0 serialization engine and proved that it will work for my structure. However by...
2
by: bg_ie | last post by:
Hi, I have a number of classes that inherit from another class which contains an attribure called "Url". I serialise my objects to an xml file, but I would like to hide the "url" attribute for...
18
by: Gabriel Rossetti | last post by:
Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work,...
0
by: parag2008 | last post by:
I have created a web service in java. This web service is invoked from a .net client, the proxies of which are generated by the Visual Studio. When I create the proxies some of the properties in a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.