Hello,
I hope I can convey my issue clearly.
I am using savetoxml and loadfromxml with some customobjects, and I have come accross the scenario where the loadfromxml is getting called on the wrong custom object. For example, the loadfromxml is failing in my Alfadata.SchematicValveConnector when attempting to read it's properties from the xml, and if I use the debugger, I see that the ByVal xmlElement As System.Xml.XmlElement looks like this in the debugger:
<Node Class="Alfadata.schematicEmptyConnector" Id="836" Version="1"> [...] </Node>
Note, that it isn't a Alfadata.SchematicValveConnector element at all, so of course it cannot find the properties that a valveconnector expects.
Tracing through the xml looking for clues, I found that another object has ID 836 listed in it's attachment section, but lists it as a SchematicValveConnector: <Node Class="Alfadata.SchematicTableConnector" Id="350" Version="1"> <Bounds>2095.528, 1452.104, 37.59689, 2</Bounds> <ZIndex>350</ZIndex> <HyperLink /> <ToolTip /> <Locked>False</Locked> <Visible>True</Visible> <Printable>True</Printable> <Brush Id="0" /> <Pen> <Color>#00FFFFFF</Color> <DashOffset>0</DashOffset> <DashStyle>0</DashStyle> <LineJoint>0</LineJoint> <MiterLimit>10</MiterLimit> <Width>0</Width> </Pen> <Font> <Name>Tahoma</Name> <Size>3.5</Size> <Unit>0</Unit> <Bold>False</Bold> <Italic>False</Italic> <Underline>False</Underline> <Strikeout>False</Strikeout> <GdiCharSet>0</GdiCharSet> </Font> <ShadowBrush Id="0" /> <ShadowOffsetX>0</ShadowOffsetX> <ShadowOffsetY>0</ShadowOffsetY> <SubordinateGroup> <MainItem Id="350" ClassId="Alfadata.SchematicTableConnector" Version="1" /> <Attachments> <Attachment> <Item Id="836" ClassId="Alfadata.SchematicValveConnector" Version="1" /> <Type>6</Type> <Data>3</Data> <Percents>-9.466553, -9.466675, -28.13034, 7.466675</Percents> </Attachment> <Attachment> <Item Id="985" ClassId="Alfadata.SchematicValveConnector" Version="1" /> <Type>6</Type> <Data>3</Data> <Percents>-9.466553, -9.466675, -28.13034, 7.466675</Percents> </Attachment> </Attachments> <Visible>True</Visible> <AutoDeleteItems>False</AutoDeleteItems> <Expandable>False</Expandable> <FollowMasterRotation>False</FollowMasterRotation> <PrevRect>2095.528, 1452.104, 37.59689, 2</PrevRect> <FollowMasterContainment>False</FollowMasterContainment> </SubordinateGroup>
[...]
I am trying to figure out how it is possible for the attachment section to have this listed as a different type of object than the actual object was saved as, so I can fix it and prevent it from using the wrong custom object to load the XML with. Can you provide any direction?
Thanks again for your support.
|