コード例 #1
0
        internal void Dispose()
        {
            var el = Document.GetElementById(_WorkspaceElementId);

            el.ParentNode.RemoveChild(el);
            _Workspace.clear();
            _Workspace.dispose();
        }
コード例 #2
0
ファイル: Storage.cs プロジェクト: h7ga40/BlockFactory
        /// <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);
        }