/// ----------------------------------------------------------------------------------- /// <summary> /// Clean up any resources being used. /// </summary> /// ----------------------------------------------------------------------------------- protected override void Dispose(bool fDisposing) { System.Diagnostics.Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** "); base.Dispose(fDisposing); if (fDisposing) { if (components != null) { components.Dispose(); } if (m_draftView != null) { m_draftView.Dispose(); } if (m_isNewCache && (m_cache != null)) { m_cache.Dispose(); // Only if we made it. } if (m_Persistence != null) { m_Persistence.Dispose(); } } m_cache = null; m_draftView = null; m_styleSheet = null; m_rootb = null; m_Persistence = null; }
/// ----------------------------------------------------------------------------------- /// <summary> /// Creates a dummy draft view in the main window. /// </summary> /// ----------------------------------------------------------------------------------- public void CreateDraftView() { // Check for verse bridge if (m_dummyDraftView != null) { m_dummyDraftView.Dispose(); } m_dummyDraftView = new DummyDraftView(Cache, false, Handle.ToInt32()); m_dummyDraftView.Name = "dummyDraftView"; m_dummyDraftView.Visible = true; m_dummyDraftView.StyleSheet = StyleSheet; m_dummyDraftView.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; m_dummyDraftView.Dock = DockStyle.Fill; Controls.Add(m_dummyDraftView); m_rgClientViews.Add(m_dummyDraftView.GetType().Name, m_dummyDraftView); m_dummyDraftView.MakeRoot(); // JT needed to add this to get tests to pass. m_dummyDraftView.ActivateView(); // m_dummyDraftView.TeEditingHelper.InTestMode = true; }