private void Form1_Load(object sender, EventArgs e) { NotificationIcon.Visible = Settings.Default.TrayNotifications || Settings.Default.MinimizeToTray; NotificationIcon.BalloonTipClicked += NotificationIconClick; NotificationIcon.DoubleClick += NotificationIconClick; txtLogPath.TextChanged += txtLogPath_TextChanged; txtLogPath.Click += txtLogPath_Click; txtLogPath.Text = Settings.Default.LogPath; // TODO: Most of these could be easily replaced with a method to map the toolstrip to the setting. tsmNotifyMinimizedOnly.Checked = Settings.Default.NotifyMinimizedOnly; tsmEnableTrayNotifications.Checked = Settings.Default.TrayNotifications; tsmEnableSMTPNotifications.Checked = Settings.Default.EnableSmtpNotifications; tsmEnablePushBullet.Checked = Settings.Default.EnablePushbullet; tsmEnableSound.Checked = Settings.Default.EnableSound; tsmAutoStart.Checked = Settings.Default.AutoStartWhenOpened; tsmMinimizeToTray.Checked = Settings.Default.MinimizeToTray; tsmLogPartyMessages.Checked = Settings.Default.LogPartyMessages; this.Resize += Main_Resize; if (!LogMonitor.IsValidLogPath(txtLogPath.Text)) { string DefaultLogPath; if (LogMonitor.TryGetDefaultLogPath(out DefaultLogPath)) { txtLogPath.Text = DefaultLogPath; } else { AppendMessage("Unable to figure out client.txt location. You will have to manually set the path."); } } if (Settings.Default.AutoStartWhenOpened) { Start(true); } }