/// <summary> /// Show serialized item in browser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void OnViewXmlClick(object sender, EventArgs e) { ConfigurationSaver.SaveAs(this, "temp.xml"); System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(); psi.FileName = "temp.xml"; psi.Verb = "open"; psi.UseShellExecute = true; psi.CreateNoWindow = true; System.Diagnostics.Process.Start(psi); }
/// <summary> /// Save item from LM to a file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void OnSaveAsClick(object sender, EventArgs e) { SaveFileDialog fd = new SaveFileDialog(); fd.AddExtension = true; fd.DefaultExt = "xml"; if (fd.ShowDialog() == DialogResult.OK) { try { ConfigurationSaver.SaveAs(this, fd.FileName); } catch (Exception ex) { MessageBox.Show(ex.Message, "Save as..."); } } }