internal void Dispose() { var el = Document.GetElementById(_WorkspaceElementId); el.ParentNode.RemoveChild(el); _Workspace.clear(); _Workspace.dispose(); }
/// <summary> /// Load blocks from XML. /// </summary> /// <param name="xml">Text representation of XML.</param> /// <param name="workspace">Workspace.</param> private static void loadXml_(string xmlStr, WorkspaceSvg workspace) { Element xml; try { xml = Blockly.Xml.textToDom(xmlStr); } catch (Exception) { BlocklyStorage.alert(BlocklyStorage.XML_ERROR + "\nXML: " + xmlStr); return; } // Clear the workspace to avoid merge. workspace.clear(); Blockly.Xml.domToWorkspace(xml, workspace); }