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()); }
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); }
// 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); }
// 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); }
// 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); }
int IVsLibrary.SaveState(Microsoft.VisualStudio.OLE.Interop.IStream pIStream, LIB_PERSISTTYPE lptType) => VSConstants.E_NOTIMPL;
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); }