예제 #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);
     }
 }
예제 #2
0
파일: Snapin.cs 프로젝트: formist/LinkMe
        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)
            {
            }
        }
예제 #3
0
파일: Snapin.cs 프로젝트: formist/LinkMe
        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)
            {
            }
        }