NodeDataType
this must be a class inheriting from Northwoods.GoXam.Model.GraphLinksModelNodeData<NodeKey>
LinkDataType
this must be a class inheriting from Northwoods.GoXam.Model.GraphLinksModelLinkData<NodeKey,PortKey>
Northwoods.GoSilverlight 1.3.5 Assembly
Load<NodeDataType,LinkDataType>(XContainer,Func<XElement,NodeDataType>,Func<XElement,LinkDataType>) Method
See Also  Send Feedback
Northwoods.GoXam.Model Namespace > GraphLinksModel<NodeType,NodeKey,PortKey,LinkType> Class > Load Method : Load<NodeDataType,LinkDataType>(XContainer,Func<XElement,NodeDataType>,Func<XElement,LinkDataType>) Method

root
the XContainer holding all of the data
nodedataallocator
a function that takes an XElement and returns either a newly constructed object of type NodeDataType or null if that XElement is to be ignored
linkdataallocator
a function that takes an XElement and returns either a newly constructed object of type LinkDataType or null if that XElement is to be ignored
Given a Linq for XML XContainer holding node and link data, replace this model's NodesSource and LinksSource collections with collections of new node data and new link data.

Syntax

Parameters

root
the XContainer holding all of the data
nodedataallocator
a function that takes an XElement and returns either a newly constructed object of type NodeDataType or null if that XElement is to be ignored
linkdataallocator
a function that takes an XElement and returns either a newly constructed object of type LinkDataType or null if that XElement is to be ignored

Type Parameters

NodeDataType
this must be a class inheriting from Northwoods.GoXam.Model.GraphLinksModelNodeData<NodeKey>
LinkDataType
this must be a class inheriting from Northwoods.GoXam.Model.GraphLinksModelLinkData<NodeKey,PortKey>

Remarks

This will iterate over all of the child elements of the root container, calling nodedataallocator on each one. If that function returns non-null, it calls LoadFromXElement on the new data and then adds it to the NodesSource collection. It will then iterate again over all of the child elements of the root container, calling linkdataallocator on each one. If that function returns non-null, it calls GraphLinksModelLinkData<NodeKey,PortKey>.LoadFromXElement on the new data and then adds it to the LinksSource collection.

All of the changes to this model are performed within a transaction.

This does not set the IsModified property to false. You may wish to do so, depending on your application requirements. You might also wish to clear the UndoManager.

Requirements

See Also

© 2012 All Rights Reserved.