private void btnEditConfiguration_Click(object sender, EventArgs e) { var content = _fs.GetConfigurationContent(_edsvc.CurrentConnection); var dlg = new XmlEditorDialog(_edsvc); dlg.OnlyValidateWellFormedness = true; dlg.XmlContent = content; if (dlg.ShowDialog() == DialogResult.OK) { content = dlg.XmlContent; _fs.SetConfigurationContent(_edsvc.CurrentConnection, content); OnResourceChanged(); } }
private void btnEditAsXml_Click(object sender, EventArgs e) { string xml = _comp.ToXml(); XmlEditorDialog diag = new XmlEditorDialog(); diag.OnlyValidateWellFormedness = true; diag.XmlContent = xml; if (diag.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _comp.UpdateFromXml(diag.XmlContent); RefreshPreviews(true, false); lstInstances.Clear(); imgPreviews.Images.Clear(); foreach (var sym in _comp.SymbolInstance) { AddInstance(sym, false); } } }
public override void Run() { var wb = Workbench.Instance; var ed = wb.ActiveEditor; if (ed != null && ed.CanEditAsXml) { var win = new XmlEditorDialog(ed.EditorService); win.SetXmlContent(ed.GetXmlContent(), ed.Resource.ResourceType); if (win.ShowDialog() == DialogResult.OK) { // // // ed.EditorService.UpdateResourceContent(win.XmlContent); ((ResourceEditorService)ed.EditorService).ReReadSessionResource(); ed.EditorService = ed.EditorService; } } }