/// <summary> /// Saves a category by updating its XML (does not save XML for /// elements that are not categories). /// </summary> /// <param name="workspace">The workspace to save category entry /// from.</param> public void saveFromWorkspace(Blockly.Workspace workspace) { // Only save XML for categories and flyouts. if (this.type == ListElement.TYPE_FLYOUT || this.type == ListElement.TYPE_CATEGORY) { this.xml = Blockly.Xml.workspaceToDom(workspace); } }
/// <summary> /// Block Exporter Tools Class /// </summary> public BlockExporterTools() { // Create container for hidden workspace. this.container = (HTMLDivElement)goog.dom.createDom("div", new Dictionary <string, string> { { "id", "blockExporterTools_hiddenWorkspace" } }, ""); // Empty quotes for empty div. // Hide hidden workspace. this.container.Style.Display = Display.None; Document.Body.AppendChild(this.container); /// <summary> /// Hidden workspace for the Block Exporter that holds pieces that make /// up the block /// </summary> this.hiddenWorkspace = Blockly.Core.inject(this.container.Id, new Dictionary <string, object> { { "collapse", false }, { "media", "../../media/" } }); }