internal void Serialize(Stream stream, NuGetSettings settings)
 {
     using (var streamWriter = new StreamWriter(stream, Encoding.UTF8, bufferSize: _bufferSize, leaveOpen: true))
         using (var jsonWriter = new JsonTextWriter(streamWriter))
         {
             _serializer.Serialize(jsonWriter, settings);
         }
 }
        // Called by the shell if the _strSolutionUserOptionsKey section declared in LoadUserOptions() as
        // being written by this package has been found in the suo file
        public int ReadUserOptions(IStream pOptionsStream, string _)
        {
            _settings = new NuGetSettings();

            try
            {
                using (var stream = new DataStreamFromComStream(pOptionsStream))
                {
                    NuGetSettings settings = _serializer.Deserialize(stream);

                    if (settings != null)
                    {
                        _settings = settings;
                    }
                }
            }
            catch
            {
            }

            return(VSConstants.S_OK);
        }