Ejemplo n.º 1
0
        public void Save(Microsoft.VisualStudio.OLE.Interop.IStream pOptionsStream)
        {
            DataStreamFromComStream pStream   = new DataStreamFromComStream(pOptionsStream);
            BinaryFormatter         formatter = new BinaryFormatter();

            formatter.Binder         = new AllowAllAssemblyVersionsDeserializationBinder();
            formatter.AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;//!!! while develop !!!
            formatter.Serialize(pStream, new CPPropsDeSerializator());
        }
Ejemplo n.º 2
0
        public void SetPropsStream(Microsoft.VisualStudio.OLE.Interop.IStream _propsStream)
        {
            DataStreamFromComStream pStream = new DataStreamFromComStream(_propsStream);

            if (propsStream != null)
            {
                propsStream = null;
            }
            propsStream = new MemoryStream();
            pStream.CopyTo(propsStream);
        }
Ejemplo n.º 3
0
        // Called by the shell to let the package write user options under the specified key.
        public int WriteUserOptions(IStream pOptionsStream, string _)
        {
            try
            {
                using (var stream = new DataStreamFromComStream(pOptionsStream))
                {
                    _serializer.Serialize(stream, _settings);
                }
            }
            catch
            {
            }

            return(VSConstants.S_OK);
        }
        int IVsPersistSolutionOpts.WriteUserOptions(Microsoft.VisualStudio.OLE.Interop.IStream pOptionsStream, string pszKey)
        {
            try
            {
                using (var stream = new DataStreamFromComStream(pOptionsStream))
                {
                    BinaryFormatter serializer = new BinaryFormatter();
                    serializer.Serialize(stream, _nugetSettings);
                }
            }
            catch (Exception)
            {
            }

            return(VSConstants.S_OK);
        }
        int IVsPersistSolutionOpts.ReadUserOptions(Microsoft.VisualStudio.OLE.Interop.IStream pOptionsStream, string pszKey)
        {
            try
            {
                using (var stream = new DataStreamFromComStream(pOptionsStream))
                {
                    BinaryFormatter serializer = new BinaryFormatter();
                    var             obj        = serializer.Deserialize(stream) as NuGetSettings;
                    if (obj != null)
                    {
                        _nugetSettings = obj;
                    }
                }
            }
            catch (Exception)
            {
            }

            return(VSConstants.S_OK);
        }
Ejemplo n.º 6
0
        // 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))
                {
                    var serializer = new BinaryFormatter();
                    var obj        = serializer.Deserialize(stream) as NuGetSettings;
                    if (obj != null)
                    {
                        _settings = obj;
                    }
                }
            }
            catch
            {
            }

            return(VSConstants.S_OK);
        }
Ejemplo n.º 7
0
        // 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);
        }
Ejemplo n.º 8
0
 int IVsLibrary.SaveState(Microsoft.VisualStudio.OLE.Interop.IStream pIStream, LIB_PERSISTTYPE lptType)
 => VSConstants.E_NOTIMPL;
Ejemplo n.º 9
0
 public int DumpOutput(uint dwReserved, VSTASKCATEGORY cat, Microsoft.VisualStudio.OLE.Interop.IStream pstmOutput, out int pfOutputWritten)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 int IVsLibrary.LoadState(Microsoft.VisualStudio.OLE.Interop.IStream pIStream, LIB_PERSISTTYPE lptType)
 {
     return(VSConstants.E_NOTIMPL);
 }