protected override void Run() { //TODO: patch the FileSelectorDialog to allow specific addin paths to be used ? FileChooserDialog dlg = new FileChooserDialog( GettextCatalog.GetString("Select Executable"), null, FileChooserAction.Open, "gtk-cancel", ResponseType.Cancel, "gtk-open", ResponseType.Accept ); dlg.SelectMultiple = false; dlg.LocalOnly = true; dlg.Modal = true; dlg.SetCurrentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); FileFilter filterAll = new FileFilter(); filterAll.AddPattern("*"); filterAll.Name = GettextCatalog.GetString("All files"); dlg.AddFilter(filterAll); if (dlg.Run() == (int)ResponseType.Accept) { ProfilingService.LoadSnapshot(dlg.Filename); } dlg.Destroy(); }
public void Load() { XmlDocument doc = new XmlDocument(); if (!File.Exists(filename)) { return; } try { doc.Load(filename); foreach (XmlNode node in doc.DocumentElement.SelectNodes("ProfilingSnapshot")) { if (node.NodeType != XmlNodeType.Element) { continue; } XmlElement element = node as XmlElement; ProfilingService.LoadSnapshot(element.GetAttribute("profiler"), element.GetAttribute("filename")); } } catch (Exception e) { LoggingService.LogError("ProfilingSnapshotCollection", "Load Profiling Snapshots", e); } }