private User ReadUserFile(string userName, string path)
        {
            var user = new User(userName, path);

            try
            {
                try
                {
                    user.Load(/*forceReadIncompatibleVersion*/ false);
                }
                catch (IncompatibleVersionException)
                {
                    IncompatibleVersion();
                    user.Load(/*forceReadIncompatibleVersion*/ true);
                }
                catch (FileNotFoundException)
                {
                    MessageBox.Show(this, "User file \"" + path + "\" is missing in user data location. Exiting application.", "User file not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                    return(null);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(this, "Unable to load user file: " + e.Message + " Exiting application.", "Unable to load user file", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
            return(user);
        }
 private User ReadUserFile(string userName, string path)
 {
     var user = new User(userName, path);
     try
     {
         try
         {
             user.Load(/*forceReadIncompatibleVersion*/false);
         }
         catch (IncompatibleVersionException)
         {
             IncompatibleVersion();
             user.Load(/*forceReadIncompatibleVersion*/true);
         }
         catch (FileNotFoundException)
         {
             MessageBox.Show(this, "User file \"" + path + "\" is missing in user data location. Exiting application.", "User file not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
             Application.Exit();
             return null;
         }
     }
     catch (Exception e)
     {
         MessageBox.Show(this, "Unable to load user file: " + e.Message + " Exiting application.", "Unable to load user file", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Application.Exit();
     }
     return user;
 }