473,387 Members | 3,821 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,387 software developers and data experts.

OVerriding specialized XML serialization in presence of IEnumerable.

Hi,

I have created a class that supports IEnumerable. This class just defines a
3D box in a voxel space. I am using IEnumerable so that I can use the
"foreach()" construct to iterate through all the voxels in this space.
Unfortunately, it seems that I can no longer save this simple 3D box class
to disk since XML, when it seems the IEnumerable interface, attempts to save
all the individual coordinates of the voxels.

For example I have basically the following class:

class BoundBox3 : IEnumerable {
public Vector3 Minimum;
public Vector3 Maximum;

IEnumerable.GetEnumerator() {
return ...;
}
}

I use it all the time to do things like:

BoundBox3 myRegion = ...;
foreach( Vector3 voxel in myRegion ) {
}

And as I specified above since the XML serializer is so smart and I can not
find the appropriate XML attribute to override this behavior I am sort of
suck. I guess I can add a separate class which contains the IEnumerable and
takes a BoundBox3 but this isn't that convenient.

Any help is appreciated,
-ben houston
http://www.exocortex.org/ben

Nov 15 '05 #1
0 1061

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ian | last post by:
I've got this problem with overriding attributes on an inheritance chain where the XmlSerializer is concerned. For example: public class A { private string aWord = String.Empty(); public...
0
by: rein.petersen | last post by:
Hi All, Some of you may have encountered complications when trying to serialize an object derived from CollectionBase (implementing ICollection or IEnumerable). Specifically, the...
5
by: Arjen | last post by:
Hello, Can somebody help me a little bit? I can't get it to work. Please see my code below... I have placed some comments like "// And whats next?". I'm sure that I have to code something...
0
by: Jason | last post by:
Anyone got examples of using serialization with a collection object that uses IEnumerable, not ICollection. I'm having trouble rendering mine.
2
by: byoukstetter | last post by:
So, I have an interface with several overriding methods: using System; using System.Collections.Specialized; namespace some.name.space { public interface IVrsPersistenceProvider { string...
5
by: George Ter-Saakov | last post by:
I have 2 classes one is document and another is collection of documents. When i am trying to use XmlSerializer to serialize class which has clsDcoumentIds member variable i am getting an exception...
2
by: Ethem Azun | last post by:
Hi, I have a collection class called Printers that implement the ICollection and IEnumerable. This class contains a private ArrayList that holds the Printer objects. The printer class is a...
1
by: Eric Porter | last post by:
Help! Below is some code for a Web Service which has two methods, First() and Second(). However, when the code is run, whichever of the two methods appears second in the source fails with...
4
by: cwertman | last post by:
Ok the XmlSerializer is nice for my need. BUT I what I need (maybe the XmlSerializer isnt what I need) is to be able to take the following objects A Person who has a collection of Addresses ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.