Reputation: 129
I want to ask if it is possible to use XElement as array... There is sample how I created that and use that.
XElement[] tracks = new XElement[pauses.Count + 1];
tracks[0].Add(Trackpoint)
Unfortunately it throws exception:
An unhandled exception of type 'System.NullReferenceException' occurred in ***.exe. Additional information: Object reference not set to an instance of an object.
It is quite obvious that I can't do this this way. Is there any another solution how could I do this?
Upvotes: 0
Views: 492
Reputation: 238
You initialized the array
, but all elements are null
. Add a reference to a new XElement
at each index before using it.
Upvotes: 1