private void LoadingWindowLocation() { WindowReality.LoadFile(); int widthsize = 0; allscreen = System.Windows.Forms.Screen.AllScreens; try { for (int i = 1; i <= WindowReality.MonitorNumber; i++) { if (i == WindowReality.MonitorNumber) { if (WindowReality.LocationMode == LocationMode.Left) { this.Left = widthsize + 1; } else { this.Left = widthsize + allscreen[i - 1].Bounds.Width - this.Width - 1; } } widthsize += allscreen[i - 1].Bounds.Width; } } catch (Exception) { if (WindowReality.LocationMode == LocationMode.Left) { this.Left = 0; } else { this.Left = SystemParameters.PrimaryScreenWidth - this.Width - 1; } } this.Top = WindowReality.TopWindow; }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Items.Save(); Seting.SaveFile(); WindowReality.SaveFile(this.Top, NowMonitorFocus + 1); }