private void mnuThemeExport_Click(object sender, EventArgs e) { var node = TreeView.SelectedNode; var ds = (ThemeDS)node.Tag; var theme = (ThemeDS.ThemeRow)node.Tag; var newDs = new ThemeDS(); newDs.Theme.ImportRow(theme); newDs.WriteXml("export theme.xml"); }
private TreeNode AddStyleRuleNode(TreeNode parent, ThemeDS.StyleRuleRow styleRule) { if (parent == null) throw new ArgumentNullException("parent"); if (styleRule == null) throw new ArgumentNullException("styleRule"); TreeNode node = parent.Nodes.Add(styleRule.Name); node.Tag = new StyleRule(styleRule); //node.ContextMenuStrip = cmnDisplay; _objectsNode.Add(styleRule, node); return node; }
private TreeNode AddLabelNode(TreeNode parent, ThemeDS.LabelRuleRow label) { if (parent == null) throw new ArgumentNullException("parent"); if (label == null) throw new ArgumentNullException("label"); TreeNode node = parent.Nodes.Add(label.Name); node.Tag = new LabelRule(label); node.ContextMenuStrip = cmnLayer; _objectsNode.Add(label, node); return node; }
private TreeNode AddLayerNode(TreeNode parent, ThemeDS.LayerRow layerRow) { if (parent == null) throw new ArgumentNullException(); var node = parent.Nodes.Add(layerRow.Name); node.Tag = new Layer(layerRow); node.ContextMenuStrip = cmnLayer; _objectsNode.Add(layerRow, node); foreach (var style in layerRow.GetStyleRuleRows()) AddStyleRuleNode(node, style); foreach (var label in layerRow.GetLabelRuleRows()) AddLabelNode(node, label); return node; }
private void AddGroupNode(TreeNode node, ThemeDS.LayerGroupRow layerGroupRow) { }
private TreeNode AddThemeNode(ThemeDS.ThemeRow theme) { var node = _treeView.Nodes.Add(theme.Name); node.Tag = new Theme(theme); node.ContextMenuStrip = cmnTheme; _objectsNode.Add(theme, node); foreach (var root in theme.GetLayerGroupRows()) foreach (var item in root.GetLayerRows()) { foreach (var group in root.GetLayerGroupRows()) AddGroupNode(node, group); AddLayerNode(node, item); } return node; }