public static void SavePosition(IPreferences preferences) { if(taskWindow != null) { int x; int y; int width; int height; taskWindow.GetPosition(out x, out y); taskWindow.GetSize(out width, out height); lastXPos = x; lastYPos = y; preferences.SetInt("MainWindowLastXPos", lastXPos); preferences.SetInt("MainWindowLastYPos", lastYPos); preferences.SetInt("MainWindowWidth", width); preferences.SetInt("MainWindowHeight", height); } }