public static void ResetAllPresets() { string commonAppData = System.IO.Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Hen IT\\QuickMon 3"); List <AgentPresetConfig> presets = AgentPresetConfig.ReadPresetsFromDirectory(commonAppData); SaveAllPresetsToFile(presets); }
static void Main(string[] args) { if (Properties.Settings.Default.NewVersion) { Properties.Settings.Default.Upgrade(); Properties.Settings.Default.NewVersion = false; Properties.Settings.Default.Save(); } if (Properties.Settings.Default.RecentQMConfigFiles == null) { Properties.Settings.Default.RecentQMConfigFiles = new System.Collections.Specialized.StringCollection(); } if (Properties.Settings.Default.KnownRemoteHosts == null) { Properties.Settings.Default.KnownRemoteHosts = new System.Collections.Specialized.StringCollection(); } Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Copy installed presets to user's application data directory try { if (!System.IO.File.Exists(MonitorPack.GetQuickMonUserDataTemplatesFile())) { string commonAppData = System.IO.Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Hen IT\\QuickMon 3"); List <AgentPresetConfig> presets = AgentPresetConfig.ReadPresetsFromDirectory(commonAppData); AgentPresetConfig.SaveAllPresetsToFile(presets); } } catch { } //if application is launched with qmconfig file set it as last Monitor pack if (args.Length > 0 && System.IO.File.Exists(args[0]) && (args[0].ToLower().EndsWith(".qmconfig") || args[0].ToLower().EndsWith(".qmp"))) { Properties.Settings.Default.LastMonitorPack = args[0]; } Application.Run(new MainForm()); }