예제 #1
0
        // This is only called from ApplicationProxyInternal.GetSaveHistoryBytes when
        // we are persisting the entire journal; we only do that when we're quitting.
        // [new] Also when navigating a Frame that has its own journal.
        //


        internal void PruneKeepAliveEntries()
        {
            for (int i = TotalCount - 1; i >= 0; --i)
            {
                JournalEntry je = _journalEntryList[i];
                if (je.IsAlive())
                {
                    RemoveEntryInternal(i);
                }
                else
                {
                    Debug.Assert(je.GetType().IsSerializable);
                    // There can be keep-alive JEs creates for child frames.
                    DataStreams jds = je.JEGroupState.JournalDataStreams;
                    if (jds != null)
                    {
                        jds.PrepareForSerialization();
                    }

                    if (je.RootViewerState != null)
                    {
                        je.RootViewerState.PrepareForSerialization();
                    }
                }
            }
        }