Esempio n. 1
0
 internal virtual void ReadState(ComStream stream)
 {
     if ( stream.Length > 0 )
     {
         BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.Persistence));
         m_data = (Hashtable) formatter.Deserialize(stream);
     }
 }
Esempio n. 2
0
        void IPersistStream.Load(IStream pStm)
        {
            try
            {
                // Load the state itself.

                ComStream stream = new ComStream(pStm);
                m_persistentState.ReadState(stream);

                // Give the snapin a chance to load now that the state is loaded.

                LoadState();
            }
            catch (Exception)
            {
            }
        }
Esempio n. 3
0
        void IPersistStream.Save(IStream pStm, [In, MarshalAs(UnmanagedType.Bool)] bool fClearDirty)
        {
            try
            {
                // Ask the snapin to save all its state.

                SaveState();

                // Save the state itself.

                ComStream stream = new ComStream(pStm);
                m_persistentState.WriteState(stream);
                if (fClearDirty)
                {
                    m_persistentState.IsDirty = false;
                }
            }
            catch (Exception)
            {
            }
        }