public override void OnEnter() { XmlNode parentNode = DataMakerXmlUtils.XmlRetrieveNode(parentNodeReference.Value); _node = parentNode.OwnerDocument.CreateNode(XmlNodeType.Element, nodeName.Value, null); if (!string.IsNullOrEmpty(storeReference.Value)) { DataMakerXmlUtils.XmlStoreNode(_node, storeReference.Value); } SetAttributes(); if (insert == InsertNodeType.AfterChild) { XmlNode refChild = DataMakerXmlUtils.XmlRetrieveNode(childNodeReference.Value); parentNode.InsertAfter(_node, refChild); } else if (insert == InsertNodeType.BeforeChild) { XmlNode refChild = DataMakerXmlUtils.XmlRetrieveNode(childNodeReference.Value); parentNode.InsertBefore(_node, refChild); } else if (insert == InsertNodeType.PrependChild) { parentNode.PrependChild(_node); } else if (insert == InsertNodeType.AppendChild) { parentNode.AppendChild(_node); } _node.InnerText = nodeInnerText.Value; Finish(); }
void LoadFromText() { XmlNode _node = DataMakerXmlUtils.StringToXmlNode(source.text); if (_node == null) { Debug.LogError(DataMakerXmlUtils.lastError); Fsm.EventData.StringData = DataMakerXmlUtils.lastError; Fsm.Event(errorEvent); return; } if (!storeReference.IsNone) { DataMakerXmlUtils.XmlStoreNode(_node, storeReference.Value); } GameObject go = Fsm.GetOwnerDefaultTarget(gameObject); DataMakerXmlProxy proxy = DataMakerCore.GetDataMakerProxyPointer(typeof(DataMakerXmlProxy), go, reference.Value, false) as DataMakerXmlProxy; if (proxy != null) { proxy.InjectXmlNode(_node); } if (!xmlString.IsNone) { xmlString.Value = source.text; } Finish(); }
public override void OnEnter() { if (reset.Value) { reset.Value = false; if (index.IsNone) { nextItemIndex = 0; } else { nextItemIndex = index.Value; } _nodeList = null; } if (_nodeList == null) { _nodeList = DataMakerXmlUtils.XmlRetrieveNodeList(nodeListReference.Value); if (_nodeList == null) { Fsm.Event(finishedEvent); return; } } DoGetNextNode(); Finish(); }
void CreateNode() { XmlNode parentNode = DataMakerXmlUtils.XmlRetrieveNode(parentNodeReference.Value); if (parentNode == null) { Fsm.Event(errorEvent); return; } _node = parentNode.OwnerDocument.CreateNode(XmlNodeType.Element, nodeName.Value, null); if (_node == null) { Fsm.Event(errorEvent); return; } if (!string.IsNullOrEmpty(storeReference.Value)) { DataMakerXmlUtils.XmlStoreNode(_node, storeReference.Value); } SetAttributes(); parentNode.AppendChild(_node); _node.InnerText = nodeInnerText.Value; }
void ExecuteAction() { _parentNode = DataMakerXmlUtils.XmlRetrieveNode(parentNodeReference.Value); _node = DataMakerXmlUtils.XmlRetrieveNode(nodeReference.Value); if (_parentNode == null || _node == null) { Fsm.Event(errorEvent); return; } if (insert == InsertNodeType.AfterChild) { XmlNode refChild = DataMakerXmlUtils.XmlRetrieveNode(childNodeReference.Value); _parentNode.InsertAfter(_node, refChild); } else if (insert == InsertNodeType.BeforeChild) { XmlNode refChild = DataMakerXmlUtils.XmlRetrieveNode(childNodeReference.Value); _parentNode.InsertBefore(_node, refChild); } else if (insert == InsertNodeType.PrependChild) { _parentNode.PrependChild(_node); } else if (insert == InsertNodeType.AppendChild) { _parentNode.AppendChild(_node); } Finish(); }
public void InjectXmlString(string source) { //Debug.Log("InjectXmlString :"+source); xmlNode = DataMakerXmlUtils.StringToXmlNode(source); RegisterEventHandlers(); }
public void RefreshStringVersion() { //Debug.Log("RefreshStringVersion"); this.content = DataMakerXmlUtils.XmlNodeToString(xmlNode); //Debug.Log(this.content); isDirty = true; }
void Execute() { _oldChild = DataMakerXmlUtils.XmlRetrieveNode(childNodeReference.Value); _newChild = DataMakerXmlUtils.XmlRetrieveNode(newChildNodeReference.Value); if (_oldChild == null) { Fsm.EventData.StringData = "'childNodeReference' not found"; Fsm.Event(errorEvent); return; } if (_newChild == null) { Fsm.EventData.StringData = "'newChildNodeReference' not found"; Fsm.Event(errorEvent); return; } if (_oldChild.ParentNode == null) { Fsm.EventData.StringData = "'childNodeReference' parent not found"; Fsm.Event(errorEvent); return; } try{ _oldChild.ParentNode.ReplaceChild(_newChild, _oldChild); }catch (XmlException e) { Fsm.EventData.StringData = e.Message; Fsm.Event(errorEvent); } }
public static string GetNodeProperty(XmlNode node, string property) { if (property.StartsWith("@")) { property = property.Remove(0, 1); XmlAttribute att = node.Attributes[property]; if (att != null) { return(att.InnerText); } else { //Debug.LogWarning (property + " attribute not found"); } } else if (property.StartsWith("/") || property.StartsWith(".")) { if (property.StartsWith("/")) { property = "." + property; } XmlNode subNode = node.SelectSingleNode(property, DataMakerXmlUtils.CreateNamespaceManager(node.OwnerDocument)); if (subNode != null) { return(subNode.InnerText); } else { Debug.LogWarning(property + " not found"); } } else { if (property == "Name()") { return(node.Name); } else { XmlNode innerNode = node[property]; if (innerNode != null) { return(innerNode.InnerText); } else { return(node.InnerText); //Debug.LogWarning (property + " not found"); } } } return(""); }
private void SelectSingleNode() { if (xmlSource.Value == null) { Debug.LogWarning("XMl source is empty, or likely invalid"); Fsm.Event(errorEvent); return; } string xPathQueryString = xPath.ParseXpathQuery(this.Fsm); XmlNode node = null; try{ node = xmlSource.Value.SelectSingleNode(xPathQueryString); }catch (XPathException e) { Debug.LogWarning(e.Message); Fsm.Event(errorEvent); return; } if (node != null) { if (!xmlResult.IsNone) { xmlResult.Value = DataMakerXmlUtils.XmlNodeToString(node); } if (storeNodeProperties.Length > 0) { FsmXmlProperty.StoreNodeProperties(this.Fsm, node, storeNodeProperties); } else { storeProperties.StoreNodeProperties(this.Fsm, node); } found.Value = true; Fsm.Event(foundEvent); } else { found.Value = false; Fsm.Event(notFoundEvent); } if (!string.IsNullOrEmpty(storeReference.Value)) { DataMakerXmlUtils.XmlStoreNode(node, storeReference.Value); } Finish(); }
private void SelectNodeList() { string xPathString = xPathQuery.Value; int i = 0; foreach (FsmString xPathVar in xPathVariables) { xPathString = xPathString.Replace("_" + i + "_", xPathVar.Value); i++; } Debug.Log(xPathString); XmlNodeList nodeList = null; if (xmlSource.Value == null) { Debug.LogWarning("XMl source is empty, or likely invalid"); Fsm.Event(errorEvent); return; } try{ nodeList = xmlSource.Value.SelectNodes(xPathString); }catch (XPathException e) { Debug.LogWarning(e.Message); Fsm.Event(errorEvent); return; } if (nodeList != null) { nodeCount.Value = nodeList.Count; if (nodeList.Count == 0) { Fsm.Event(notFoundEvent); return; } if (!xmlResult.IsNone) { xmlResult.Value = DataMakerXmlUtils.XmlNodeListToString(nodeList); // Debug.Log(xmlResult.Value); } Fsm.Event(foundEvent); } else { Fsm.Event(notFoundEvent); } }
private void SelectNodeList() { nodeCount.Value = 0; if (xmlSource.Value == null) { Debug.LogWarning("XMl source is empty, or likely invalid"); Fsm.Event(errorEvent); return; } string xPathQueryString = xPath.ParseXpathQuery(this.Fsm); XmlNodeList nodeList = null; try{ nodeList = xmlSource.Value.SelectNodes(xPathQueryString, DataMakerXmlUtils.CreateNamespaceManager(xmlSource.Value.OwnerDocument)); }catch (XPathException e) { Debug.LogWarning(e.Message); Fsm.Event(errorEvent); return; } if (nodeList != null) { nodeCount.Value = nodeList.Count; if (nodeList.Count == 0) { found.Value = false; Fsm.Event(notFoundEvent); return; } if (!xmlResult.IsNone) { xmlResult.Value = DataMakerXmlUtils.XmlNodeListToString(nodeList); // Debug.Log(xmlResult.Value); } found.Value = true; Fsm.Event(foundEvent); } else { found.Value = false; Fsm.Event(notFoundEvent); } if (!string.IsNullOrEmpty(storeReference.Value)) { DataMakerXmlUtils.XmlStoreNodeList(nodeList, storeReference.Value); } }
public void InjectXmlString(string source) { //Debug.Log("InjectXmlString :"+source); xmlNode = DataMakerXmlUtils.StringToXmlNode(source); if (!string.IsNullOrEmpty(storeInMemory)) { DataMakerXmlUtils.XmlStoreNode(xmlNode, storeInMemory); } RegisterEventHandlers(); }
public void InjectXmlNodeList(XmlNodeList nodeList) { XmlDocument doc = new XmlDocument(); xmlNode = doc.CreateElement("root"); foreach (XmlNode _node in nodeList) { xmlNode.AppendChild(_node); } Debug.Log(DataMakerXmlUtils.XmlNodeToString(xmlNode)); }
public override void OnEnter() { _nodeList = DataMakerXmlUtils.XmlRetrieveNodeList(nodeListReference.Value); if (_nodeList == null) { Fsm.Event(errorEvent); } else { DoOperation(); } Finish(); }
public override void OnEnter() { XmlNode _node = DataMakerXmlUtils.XmlRetrieveNode(xmlReference.Value); if (_node != null) { _node.ParentNode.RemoveChild(_node); } else { Fsm.Event(failureEvent); } Finish(); }
public override void OnEnter() { XmlNode _node = DataMakerXmlUtils.XmlRetrieveNode(xmlReference.Value); if (_node != null) { _node.Attributes.RemoveNamedItem(attribute.Value); } else { Fsm.Event(failureEvent); } Finish(); }
void DoGetNextNode() { // no more items? int _count = _nodeList.Count; if (nextItemIndex >= _count) { nextItemIndex = 0; Fsm.Event(finishedEvent); return; } if (!string.IsNullOrEmpty(indexedNodeReference.Value)) { DataMakerXmlUtils.XmlStoreNode(_nodeList[nextItemIndex], indexedNodeReference.Value); } // get next item properties index.Value = nextItemIndex; if (storeNodeProperties.Length > 0) { FsmXmlProperty.StoreNodeProperties(this.Fsm, _nodeList[nextItemIndex], storeNodeProperties); } else { storeProperties.StoreNodeProperties(this.Fsm, _nodeList[nextItemIndex]); } // no more items? if (nextItemIndex >= _count) { Fsm.Event(finishedEvent); nextItemIndex = 0; return; } // iterate to next nextItemIndex++; if (loopEvent != null) { Fsm.Event(loopEvent); } }
public void InjectXmlNodeList(XmlNodeList nodeList) { XmlDocument doc = new XmlDocument(); xmlNode = doc.CreateElement("root"); foreach (XmlNode _node in nodeList) { xmlNode.AppendChild(_node); } if (!string.IsNullOrEmpty(storeInMemory)) { DataMakerXmlUtils.XmlStoreNode(xmlNode, storeInMemory); } RegisterEventHandlers(); }
void ConvertToJsonString() { XmlNode _node = DataMakerXmlUtils.XmlRetrieveNode(xmlReference.Value); if (_node != null) { _node.ParentNode.RemoveChild(_node); } else { Fsm.Event(errorEvent); } jsonResult.Value = JsonConvert.SerializeXmlNode(_node); Finish(); }
void OnGUI_XmlNodeListReferencePreview(string reference) { string preview = DataMakerXmlUtils.XmlNodeListToString(DataMakerXmlUtils.XmlRetrieveNodeList(reference)); if (string.IsNullOrEmpty(preview)) { GUILayout.Label("-- empty --"); } else { if (!xmlNodeListPreviewsScroll.ContainsKey(reference)) { xmlNodeListPreviewsScroll.Add(reference, Vector2.zero); } xmlNodeListPreviewsScroll [reference] = DataMakerEditorGUILayoutUtils.StringContentPreview(xmlNodeListPreviewsScroll [reference], preview); } }
public static void SetNodeProperty(XmlNode node, string property, string propertyValue) { if (property.StartsWith("@")) { property = property.Remove(0, 1); XmlAttribute att = node.Attributes[property]; if (att == null) { att = node.OwnerDocument.CreateAttribute(property); node.Attributes.Append(att); } att.InnerText = propertyValue; } else if (property.StartsWith("/") || property.StartsWith(".")) { if (property.StartsWith("/")) { property = "." + property; } XmlNode subNode = node.SelectSingleNode(property, DataMakerXmlUtils.CreateNamespaceManager(node.OwnerDocument)); if (subNode != null) { subNode.InnerText = propertyValue; } else { Debug.LogWarning(property + " not found"); } } else { XmlNode innerNode = node[property]; if (innerNode != null) { innerNode.InnerText = propertyValue; } else { //Debug.LogWarning (property + " not found"); } } }
void Refresh() { //Debug.Log("refresh"); DataMakerXmlProxy _target = target as DataMakerXmlProxy; _target.isDirty = false; if (_target.xmlNode != null) { /* * if (_target.XmlTextAsset!=null) * { * DataMakerEditorGUILayoutUtils.feedbackLabel("XML DATA CHANGED.",DataMakerEditorGUILayoutUtils.labelFeedbacks.WARNING); * } */ if (node == null || (!node.Equals(_target.xmlNode))) { node = _target.xmlNode; _target.content = DataMakerXmlUtils.XmlNodeToString(_target.xmlNode); empty = string.IsNullOrEmpty(_target.content); //Debug.Log("PARSING XML NODE"); valid = DataMakerXmlUtils.StringToXmlNode(_target.content) != null; } return; } if (_target.XmlTextAsset != null) { empty = string.IsNullOrEmpty(_target.XmlTextAsset.text); if (!empty || _target.content == null || !_target.content.Equals(_target.XmlTextAsset.text)) { _target.content = _target.XmlTextAsset.text; //Debug.Log("PARSING TEXT ASSET: \n"+_target.XmlTextAsset.text); valid = DataMakerXmlUtils.StringToXmlNode(_target.content) != null; } } }
public override void OnInspectorGUI() { DrawDefaultInspector(); DataMakerXmlNodeListProxy _target = target as DataMakerXmlNodeListProxy; if (_target._FsmXmlNodeList != null) { if (!_target._FsmXmlNodeList.Value.Equals(nodeListCache)) { nodeListCache = _target._FsmXmlNodeList.Value; content = DataMakerXmlUtils.XmlNodeListToString(nodeListCache); } DataMakerEditorGUILayoutUtils.feedbackLabel("Xml Source Valid", DataMakerEditorGUILayoutUtils.labelFeedbacks.OK); _scroll = DataMakerEditorGUILayoutUtils.StringContentPreview(_scroll, content); } else { DataMakerEditorGUILayoutUtils.feedbackLabel("Xml Source Invalid", DataMakerEditorGUILayoutUtils.labelFeedbacks.ERROR); } }
void CloneNode() { _node = DataMakerXmlUtils.XmlRetrieveNode(nodeReference.Value); if (_node == null) { Fsm.Event(errorEvent); return; } _clonedNode = _node.CloneNode(deepClone.Value); if (_clonedNode == null) { Fsm.Event(errorEvent); return; } if (!string.IsNullOrEmpty(storeCloneReference.Value)) { DataMakerXmlUtils.XmlStoreNode(_clonedNode, storeCloneReference.Value); } }
private void SetAttributes() { XmlNode _node = DataMakerXmlUtils.XmlRetrieveNode(xmlReference.Value); if (_node == null) { Debug.LogWarning("XMl reference is empty, or likely invalid"); Fsm.Event(errorEvent); return; } int att_i = 0; foreach (FsmString att in attributes) { SetNodeProperty(_node, att.Value, attributesValues[att_i].Value); att_i++; } // Debug.Log(_node.OwnerDocument.OuterXml); Finish(); }
public override void OnEnter() { GameObject go = Fsm.GetOwnerDefaultTarget(gameObject); DataMakerXmlProxy proxy = DataMakerCore.GetDataMakerProxyPointer(typeof(DataMakerXmlProxy), go, reference.Value, false) as DataMakerXmlProxy; if (proxy != null) { if (!storeReference.IsNone) { proxy.InjectXmlNode(DataMakerXmlUtils.XmlRetrieveNode(storeReference.Value)); } else if (!xmlSource.IsNone) { proxy.InjectXmlString(xmlSource.Value); } } else { Fsm.Event(errorEvent); } Finish(); }
void ConvertFromJsonString() { string _jsonSource = jsonSource.Value; /* fail to check if json root is a list of a single object... odd * // check if json has unique root or not. * try{ * * System.Object _json = (System.Object)JsonConvert.DeserializeObject(_jsonSource, typeof(System.Object)); * }catch(Exception e) * { * Debug.LogError(e.Message); * Fsm.EventData.StringData = e.Message; * Fsm.Event(errorEvent); * return; * } * * bool jsonHasRoot = _jsonSource.Length==1; * * string ForcedRootName = string.IsNullOrEmpty(rootElementName.Value)?"root":rootElementName.Value; * */ XmlDocument _document = new XmlDocument(); try{ //if(!jsonHasRoot || !string.IsNullOrEmpty(rootElementName.Value) || forceRootElementName.Value) if (!string.IsNullOrEmpty(rootElementName.Value)) { _document = JsonConvert.DeserializeXmlNode(_jsonSource, rootElementName.Value); } else { _document = JsonConvert.DeserializeXmlNode(_jsonSource); } }catch (Exception e) { Debug.LogError(e.Message); Fsm.EventData.StringData = e.Message; Fsm.Event(errorEvent); return; } if (_document == null) { Debug.LogError(DataMakerXmlUtils.lastError); Fsm.EventData.StringData = DataMakerXmlUtils.lastError; Fsm.Event(errorEvent); return; } if (!storeReference.IsNone) { if (_document.DocumentElement.GetType() == typeof(XmlNodeList)) { //DataMakerXmlUtils.XmlStoreNodeList(_document.DocumentElement as XmlNodeList,storeReference.Value); } else { DataMakerXmlUtils.XmlStoreNode(_document.DocumentElement as XmlNode, storeReference.Value); } } GameObject go = Fsm.GetOwnerDefaultTarget(gameObject); DataMakerXmlProxy proxy = DataMakerCore.GetDataMakerProxyPointer(typeof(DataMakerXmlProxy), go, reference.Value, false) as DataMakerXmlProxy; if (proxy != null) { if (_document.DocumentElement.GetType() == typeof(XmlNodeList)) { // proxy.InjectXmlNodeList(_document.DocumentElement as XmlNode); } else { proxy.InjectXmlNode(_document.DocumentElement as XmlNode); } } proxy.RefreshStringVersion(); if (!xmlString.IsNone) { xmlString.Value = proxy.content; } Finish(); }
void ConvertFromCsvString() { CsvData _data; if (!delimiter.IsNone) { _data = CsvReader.LoadFromString(csvSource.Value, hasHeader.Value, delimiter.Value [0]); } else { _data = CsvReader.LoadFromString(csvSource.Value, hasHeader.Value); } XmlDocument _document = new XmlDocument(); XmlNode _root = _document.AppendChild(_document.CreateElement("Root")); try{ if (_data.HasHeader) { _csvHeader = _data.HeaderKeys.ToArray(); } foreach (List <string> _row in _data.Data) { XmlNode _xmlRowNode = _document.CreateElement("Record"); for (int i = 0; i < _row.Count; i++) { XmlNode _Item = _document.CreateElement(_data.HasHeader?_csvHeader[i]:"Field"); _Item.InnerText = _row[i]; _xmlRowNode.AppendChild(_Item); } _root.AppendChild(_xmlRowNode); } }catch (Exception e) { Debug.LogError(e.Message); Fsm.EventData.StringData = e.Message; Fsm.Event(errorEvent); return; } if (_document == null) { Debug.LogError(DataMakerXmlUtils.lastError); Fsm.EventData.StringData = DataMakerXmlUtils.lastError; Fsm.Event(errorEvent); return; } if (!storeReference.IsNone) { if (_document.DocumentElement.GetType() == typeof(XmlNodeList)) { // DataMakerXmlUtils.XmlStoreNodeList(_document.DocumentElement as XmlNodeList,storeReference.Value); } else { DataMakerXmlUtils.XmlStoreNode(_document.DocumentElement as XmlNode, storeReference.Value); } } GameObject go = Fsm.GetOwnerDefaultTarget(gameObject); if (go != null) { DataMakerXmlProxy proxy = DataMakerCore.GetDataMakerProxyPointer(typeof(DataMakerXmlProxy), go, reference.Value, false) as DataMakerXmlProxy; if (proxy != null) { if (_document.DocumentElement.GetType() == typeof(XmlNodeList)) { // proxy.InjectXmlNodeList(_document.DocumentElement as XmlNode); } else { proxy.InjectXmlNode(_document.DocumentElement as XmlNode); } } proxy.RefreshStringVersion(); } if (!xmlString.IsNone) { xmlString.Value = DataMakerXmlUtils.XmlNodeToString(_document.DocumentElement as XmlNode); } Finish(); }
public static bool EditFsmXmlSourceField(Fsm fsm, FsmXmlSource source) { source.sourceSelection = EditorGUILayout.Popup("Source selection", source.sourceSelection, source.sourceTypes); if (source.sourceString == null) { source.sourceString = new FsmString(); } source.sourceString.UseVariable = source.sourceSelection == 2; bool showPreview = false; string preview = ""; if (source.sourceSelection == 0) { source._sourceEdit = EditorGUILayout.Foldout(source._sourceEdit, new GUIContent("Edit")); if (source._sourceEdit) { source.sourceString.Value = EditorGUILayout.TextArea(source.sourceString.Value, GUILayout.Height(200)); } } else if (source.sourceSelection == 1) { source.sourcetextAsset = (TextAsset)EditorGUILayout.ObjectField("TextAsset Object", source.sourcetextAsset, typeof(TextAsset), false); if (source.sourcetextAsset != null) { source._sourcePreview = EditorGUILayout.Foldout(source._sourcePreview, new GUIContent("Preview")); showPreview = source._sourcePreview; preview = source.sourcetextAsset.text; } } else if (source.sourceSelection == 2) { source.sourceString = VariableEditor.FsmStringField(new GUIContent("Fsm String"), fsm, source.sourceString, null); if (!source.sourceString.UseVariable) { source.sourceSelection = 0; return(true); } if (!source.sourceString.IsNone) { source._sourcePreview = EditorGUILayout.Foldout(source._sourcePreview, new GUIContent("Preview")); showPreview = source._sourcePreview; preview = source.sourceString.Value; } } else if (source.sourceSelection == 3) { if (source.sourceProxyGameObject == null) { source.sourceProxyGameObject = new FsmGameObject(); source.sourceProxyReference = new FsmString(); } source.sourceProxyGameObject = VariableEditor.FsmGameObjectField(new GUIContent("GameObject"), fsm, source.sourceProxyGameObject); source.sourceProxyReference = VariableEditor.FsmStringField(new GUIContent("Reference"), fsm, source.sourceProxyReference, null); if (source.sourceProxyGameObject != null) { DataMakerXmlProxy proxy = DataMakerCore.GetDataMakerProxyPointer(typeof(DataMakerXmlProxy), source.sourceProxyGameObject.Value, source.sourceProxyReference.Value, true) as DataMakerXmlProxy; if (proxy != null) { if (proxy.XmlTextAsset != null) { source._sourcePreview = EditorGUILayout.Foldout(source._sourcePreview, new GUIContent("Preview")); showPreview = source._sourcePreview; preview = proxy.XmlTextAsset.text; } else { //oupss... } } else { //oupss.. } } } else if (source.sourceSelection == 4) { if (source.inMemoryReference == null) { source.inMemoryReference = new FsmString(); } source.inMemoryReference = VariableEditor.FsmStringField(new GUIContent("Memory Reference"), fsm, source.inMemoryReference, null); if (!string.IsNullOrEmpty(source.inMemoryReference.Value)) { source._sourcePreview = EditorGUILayout.Foldout(source._sourcePreview, new GUIContent("Preview")); showPreview = source._sourcePreview; preview = DataMakerXmlUtils.XmlNodeToString(DataMakerXmlUtils.XmlRetrieveNode(source.inMemoryReference.Value)); } } if (showPreview) { if (string.IsNullOrEmpty(preview)) { GUILayout.Label("-- empty --"); } else { source._scroll = GUILayout.BeginScrollView(source._scroll, "box", GUILayout.Height(200)); GUI.skin.box.alignment = TextAnchor.UpperLeft; GUILayout.Box(preview, "", null); GUILayout.EndScrollView(); } } return(false); }