public frmMain(bool silentMode, bool noMonitor, string key, string fileName) { try { IO.Log(string.Format("Starting Printer++: ({0},{1},{2},{3})", silentMode, noMonitor, key, fileName)); InitializeComponent(); iomh = new IOMonitorHelper(); if (silentMode == true) { WindowState = FormWindowState.Minimized; ShowInTaskbar = false; } if (!noMonitor) { iomh.StartMonitor(ConfigurationManager.AppSettings["TempDir"]); } if (!string.IsNullOrWhiteSpace(key)) { txtKey.Text = key; } else { txtKey.Text = ConfigurationManager.AppSettings["DefaultProcessor"]; } if (!string.IsNullOrWhiteSpace(fileName)) { txtFileName.Text = fileName; } Process(key, fileName); } catch (Exception ex) { ShowError(ex); } }
private void InitializeComponents() { _iomh = new IOMonitorHelper(); _contextMenu = new ContextMenu(); var exitMenuItem = new MenuItem { Text = Strings.ExitText }; exitMenuItem.Click += exitMenuItem_Click; _contextMenu.MenuItems.AddRange(new MenuItem[] { exitMenuItem }); _notifyIcon = new NotifyIcon { ContextMenu = _contextMenu, Text = Strings.ApplicationTitleText, Icon = Icon.ExtractAssociatedIcon("Doku4Signatures.ico"), Visible = true }; //_iomh.StartMonitor(Path.Combine(IO.AppRootDirectory(), "Temp")); _iomh.StartMonitor("C:\\Doku4Signatures\\Temp"); }