Exemple #1
0
 /// <include file='doc\VsService.uex' path='docs/doc[@for="VsService._LoadState"]/*' />
 /// <devdoc>
 ///     Called by the package manager to allow this service to load state out of the solutions
 ///     persistance file.
 /// </devdoc>
 internal virtual void _LoadState(NativeMethods.IStream pStream)
 {
     try {
         NativeMethods.DataStreamFromComStream writeStream = new NativeMethods.DataStreamFromComStream(pStream);
         LoadState(writeStream);
         writeStream.Dispose();
     }
     catch (Exception e) {
         Debug.Fail("Service " + this.GetType().Name + " threw an exception loading state: " + e.ToString());
     }
 }
Exemple #2
0
        /// <include file='doc\Package.uex' path='docs/doc[@for="Package.IVsPersistSolutionOpts.WriteUserOptions"]/*' />
        /// <internalonly/>
        /// <devdoc>
        /// IVsPersistSolutionOpts implementation.
        /// Called by the shell to persist our solution options.  Here is where the service
        /// can persist any goo that it cares about.
        /// </devdoc>
        int IVsPersistSolutionOpts.WriteUserOptions(IStream pStream, string pszKey) {

            try {
                NativeMethods.DataStreamFromComStream stream = new NativeMethods.DataStreamFromComStream(pStream);
                using (stream) {
                    OnSaveOptions(pszKey, stream);
                }
            }
            finally {
                // Release the pointer because VS expects it to be released upon
                // function return.
                //
                Marshal.ReleaseComObject(pStream);
            }
            return NativeMethods.S_OK;
        }
Exemple #3
0
 /// <include file='doc\VsService.uex' path='docs/doc[@for="VsService._SaveState"]/*' />
 /// <devdoc>
 ///     Called by the package manager to allow this service to persist state into the solution's
 ///     persistance file.
 /// </devdoc>
 internal virtual void _SaveState(NativeMethods.IStream pStream)
 {
     NativeMethods.DataStreamFromComStream comStream = new NativeMethods.DataStreamFromComStream(pStream);
     SaveState(comStream);
     comStream.Dispose();
 }
Exemple #4
0
        /// <include file='doc\Package.uex' path='docs/doc[@for="Package.IVsPersistSolutionOpts.WriteUserOptions"]/*' />
        /// <internalonly/>
        /// <devdoc>
        /// IVsPersistSolutionOpts implementation.
        /// Called by the shell to persist our solution options.  Here is where the service
        /// can persist any goo that it cares about.
        /// </devdoc>
        int IVsPersistSolutionOpts.WriteUserOptions(IStream pStream, string pszKey)
        {
            NativeMethods.DataStreamFromComStream stream = new NativeMethods.DataStreamFromComStream(pStream);
            using (stream) {
                OnSaveOptions(pszKey, stream);
            }

            return NativeMethods.S_OK;
        }