var destination = uComponents.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize(Model.Content.GetPropertyValue("destination").ToString()); if (!string.IsNullOrWhiteSpace(destination.Url)) { // Stuff }
Works like a charm! I'm looking for the same thing with my multi node tree picker here. Is there a fun way to do this?
Here is the piece of code I'm trying to make cooler (maybe I'm just not taking the proper approach...):
This post is a bit old, but I think I can share my experience and workaroud for situations like this.
I tried to find a deserializer as well for MultiNodeTreePicker but couldnt find any, so I created my own which handles the variables in XML format as below:
public static List<Node> GetMultiNodePickerContentItems(string xmlFormatString) { List<Node> retVal = new List<Node>();
XmlDocument xdoc = new XmlDocument(); xdoc.LoadXml(xmlFormatString);
if (xdoc.FirstChild.Name == "MultiNodePicker") { foreach (XmlNode xnod in xdoc.FirstChild.ChildNodes) { if (xnod.Name == "nodeId") { int nodeId = -1; if (Int32.TryParse(xnod.InnerText, out nodeId)) retVal.Add(new Node(nodeId)); } } } return retVal; }
And Calling it is like:
foreach (Node linkItemNode in Helper.GetMultiNodePickerContentItems(thisNode.GetProperty("links").Value)) { ................ }
Multi node tree picker deserialize
Hello,
I use this with my uComponents url picker:
Works like a charm! I'm looking for the same thing with my multi node tree picker here. Is there a fun way to do this?
Here is the piece of code I'm trying to make cooler (maybe I'm just not taking the proper approach...):
Any help will be appreciated!
Thanks!
This post is a bit old, but I think I can share my experience and workaroud for situations like this.
I tried to find a deserializer as well for MultiNodeTreePicker but couldnt find any, so I created my own which handles the variables in XML format as below:
And Calling it is like:
is working on a reply...