public MainWindow() { bool first; mutex = new Mutex(true, AppDomain.CurrentDomain.FriendlyName, out first); if (!first) { Process p = Process.GetCurrentProcess(); var pl = Process.GetProcesses().Where(x => x.ProcessName == p.ProcessName && x.MainWindowHandle != p.MainWindowHandle); MessageBox.Show("There is already a instance of sb0t running. To have additional instances, each must have a filename different from " + AppDomain.CurrentDomain.FriendlyName, "sb0t", MessageBoxButton.OK, MessageBoxImage.Error); if (pl.Count() > 0) { SetForegroundWindow(pl.ToArray()[0].MainWindowHandle); } Environment.Exit(-1); } SETTING_UP = true; this.InitializeComponent(); this.server = new ServerCore(); ServerCore.LogUpdate += this.LogUpdate; this.notify = new System.Windows.Forms.NotifyIcon(); this.notify.Text = "sb0t"; this.notify.Icon = Resource1.mains; this.notify.Click += new EventHandler(this.NotifyIconClicked); this.notify.Visible = true; GUILabels.Setup(this); }
private void EnglishClicked(object sender, MouseButtonEventArgs e) { GUILabels.SetEnglish(this); }