public override void TestTearDown()
		{
			if (m_division != null)
			{
				m_division.m_hPagesBroken.Clear();
				m_division.Dispose();
				m_division = null;
			}

			// Make sure we close all the rootboxes
			if (m_pub != null)
			{
				m_pub.Dispose();
				m_pub = null;
			}
			base.TestTearDown();
		}
Ejemplo n.º 2
0
		public override void Exit()
		{
			CheckDisposed();

			if (m_division != null)
			{
				m_division.m_hPagesBroken.Clear();
				m_division.Dispose();
				m_division = null;
			}

			// Make sure we close all the rootboxes
			if (m_pub != null)
			{
				m_pub.Dispose();
				m_pub = null;
			}
			base.Exit();
		}
Ejemplo n.º 3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Shuts down the FDO cache
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void TestTearDown()
		{
			if (m_firstDivision != null)
			{
				m_firstDivision.m_hPagesBroken.Clear();
				m_firstDivision.Dispose();
				m_firstDivision = null;
			}

			// Make sure we close all the rootboxes
			if (m_pub != null)
			{
				m_pub.Dispose();
				m_pub = null;
			}

			m_subViewVc = null;
			m_subStream = null;

			base.TestTearDown();
		}
Ejemplo n.º 4
0
		//private Form m_form;
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the division and publication.
		/// </summary>
		/// <param name="columns">The number of columns.</param>
		/// <param name="fSharedSubStreams">if set to <c>true</c> configure the print layout
		/// view using shared sub streams; otherwise, each division will create an owned
		/// substream.</param>
		/// ------------------------------------------------------------------------------------
		private void CreateDivisionAndPublication(int columns, bool fSharedSubStreams)
		{
			if (m_firstDivision != null)
				m_firstDivision.Dispose();
			if (m_pub != null)
				m_pub.Dispose();
			m_subStream = null;
			if (fSharedSubStreams)
				m_subStream = VwLayoutStreamClass.Create();
			m_firstDivision = new DummyDivision(new DummyPrintConfigurer(Cache, m_subStream),
				columns);
			IPublication pub =
				Cache.LangProject.TranslatedScriptureOA.PublicationsOC.ToArray()[0];
			m_pub = new DummyPublication(pub, m_firstDivision, DateTime.Now);
			if (fSharedSubStreams)
			{
				m_subViewVc = new DummyFirstSubViewVc();
				int hvoScr = Cache.LangProject.TranslatedScriptureOA.Hvo;
				IVwRootBox rootbox = (IVwRootBox)m_subStream;
				rootbox.DataAccess = Cache.MainCacheAccessor;
				rootbox.SetRootObject(hvoScr, m_subViewVc,
					DummyFirstSubViewVc.kfragScrFootnotes, null);

				m_pub.AddSharedSubstream(m_subStream);
			}

		}
Ejemplo n.º 5
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Shuts down the FDO cache
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void FixtureTeardown()
		{
			// Make sure we close all the rootboxes
			if (m_pub != null)
				m_pub.Dispose();
			m_pub = null;
			base.FixtureTeardown();
		}
Ejemplo n.º 6
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Configure a PublicationControl
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void ConfigurePublication()
		{
			if (m_pub != null)
				m_pub.Dispose();
			m_division = new DummyDivision(new DummyHFPrintConfigurer(Cache), 1);
			IPublication pub =
				Cache.LangProject.TranslatedScriptureOA.PublicationsOC.ToArray()[0];
			m_pub = new DummyPublication(pub, m_division, DateTime.Now);
			m_pub.Configure();

			// Check initial state
			Assert.AreEqual(m_division, m_pub.Divisions[0]);
			IVwLayoutStream layoutStream = m_division.MainLayoutStream;
			Assert.IsNotNull(layoutStream);
		}
Ejemplo n.º 7
0
		public void GetLastElement_TwoElementsRtoLStandard()
		{
			IVwLayoutStream stream = VwLayoutStreamClass.Create();
			using (DummyDivisionMgr division = new DummyDivisionMgr(stream, true))
			using (DummyPublication dummyPub = new DummyPublication(null, division, DateTime.Now))
			using (DummyPage page = new DummyPage(dummyPub))
			{

				PageElement leftColumnElement = new PageElement(division, stream, false,
					new Rectangle(0, 1440, (int)(3 * 720), (int)(5 * 1440)),
					0, true, 1, 2, 0, 5 * 1440, 0, true);
				PageElement rightColumnElement = new PageElement(division, stream, false,
					new Rectangle(3 * 720 + 360, 1440, (int)(3 * 720), (int)(9 * 1440)),
					0, true, 2, 2, 0, 9 * 1440, 0, true);

				page.PageElements.Add(leftColumnElement);
				page.PageElements.Add(rightColumnElement);

				int xd;
				PageElement lastElement = page.CallGetLastElement(division, out xd);
				Debug.WriteLine("GetLastElement_TwoElementsRtoLStandard xd: " + xd);

				Assert.AreEqual(leftColumnElement, lastElement,
					"The left-most column should be the last element in a right-to-left writing system");
				Assert.AreEqual(0, xd);
			}
		}
Ejemplo n.º 8
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Configure a PublicationControl
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void ConfigurePublication()
		{
			Dictionary<string, string> cacheOptions = new Dictionary<string, string>();
			cacheOptions.Add("db", "TestLangProj");
			m_fdoCache = FdoCache.Create(cacheOptions);
			// Make sure we don't call InstallLanguage during tests.
			m_fdoCache.LanguageWritingSystemFactoryAccessor.BypassInstall = true;

			if (m_pub != null)
				m_pub.Dispose();
			m_division = new DummyDivision(new DummyHFPrintConfigurer(m_fdoCache), 1);
			Publication pub = new Publication(m_fdoCache,
				m_fdoCache.LangProject.TranslatedScriptureOA.PublicationsOC.HvoArray[0]);
			m_pub = new DummyPublication(pub, m_division, DateTime.Now);
			m_pub.Configure();

			// Check initial state
			Assert.AreEqual(m_division, m_pub.Divisions[0]);
			IVwLayoutStream layoutStream = m_division.MainLayoutStream;
			Assert.IsNotNull(layoutStream);
		}
Ejemplo n.º 9
0
		public void AdjustScrollRange_GrowSecondDivOnPageTwo()
		{
			DummyVwLayoutStream stream1 = new DummyVwLayoutStream();
			DummyVwLayoutStream stream2 = new DummyVwLayoutStream();
			GoofyDivision divMgr1 = new GoofyDivision(stream1);
			GoofyDivision divMgr2 = new GoofyDivision(stream2);
			DummyPublication pubCtrl = new DummyPublication(null, divMgr1, DateTime.Now);
			pubCtrl.PageHeight = 72000 * 6;
			pubCtrl.AddDivision(divMgr2);
			divMgr1.m_overrideHeight = divMgr1.AvailablePageHeightInPrinterPixels;
			divMgr2.m_overrideHeight = divMgr2.AvailablePageHeightInPrinterPixels;
			divMgr2.StartAt = DivisionStartOption.Continuous;
			pubCtrl.CreatePages();
			Assert.AreEqual(3, pubCtrl.PageCount);
			divMgr1.CallAddElement(pubCtrl.Pages[0], divMgr1.m_overrideHeight - 20, 1, 1,
				divMgr1.InsideMarginInPrinterPixels, 20, divMgr1.AvailablePageHeightInPrinterPixels);
			int origTopOfPageTwoDiv1 = divMgr1.m_overrideHeight - 20;
			divMgr1.CallAddElement(pubCtrl.Pages[1], 20, 1, 1, divMgr1.OutsideMarginInPrinterPixels,
				origTopOfPageTwoDiv1, divMgr1.AvailablePageHeightInPrinterPixels);
			Page origPg3 = pubCtrl.Pages[2];
			int origTopOfPageThreeDiv2 = origPg3.OffsetFromTopOfDiv(divMgr2);
			Point origScrollPos = pubCtrl.ScrollPosition;
			Size origScrollSize = pubCtrl.AutoScrollMinSize;
			pubCtrl.AdjustScrollRange(stream2, 0, 0, divMgr2.AvailablePageHeightInPrinterPixels, 0);
			Assert.AreEqual(4, pubCtrl.PageCount);
			Assert.IsFalse(pubCtrl.Pages[0].NeedsLayout);
			Assert.IsFalse(pubCtrl.Pages[1].NeedsLayout,
				"This test simulates a call to AdjustScrollRange that happens in the middle of laying out this page, so it should not get flagged as needing layout.");
			Assert.IsTrue(pubCtrl.Pages[2].NeedsLayout);
			Assert.IsTrue(pubCtrl.Pages[3].NeedsLayout);
			Assert.AreEqual(origScrollPos, pubCtrl.ScrollPosition);
			Assert.AreEqual(origScrollSize.Height * 4 / 3, pubCtrl.AutoScrollMinSize.Height);
			Assert.AreEqual(1, pubCtrl.Pages[0].PageElements.Count);
			Assert.AreEqual(20, pubCtrl.Pages[0].PageElements[0].OffsetToTopPageBoundary);
			Assert.AreEqual(1, pubCtrl.Pages[1].PageElements.Count);
			Assert.AreEqual(origTopOfPageTwoDiv1, pubCtrl.Pages[1].OffsetFromTopOfDiv(divMgr1));
			Assert.AreEqual(0, pubCtrl.Pages[1].OffsetFromTopOfDiv(divMgr2));
			Assert.AreEqual(origPg3, pubCtrl.Pages[3],
				"A page should have been inserted between the original page 2 and page 3.");
			Assert.AreEqual(0, pubCtrl.Pages[2].PageElements.Count);
			Assert.AreEqual(divMgr2.AvailablePageHeightInPrinterPixels,
				pubCtrl.Pages[2].OffsetFromTopOfDiv(divMgr2),
				"Inserted page's offset from top of division 2 should be one ideal page from the top.");
			Assert.AreEqual(0, pubCtrl.Pages[3].PageElements.Count);
			Assert.AreEqual(origTopOfPageThreeDiv2 + divMgr2.AvailablePageHeightInPrinterPixels,
				pubCtrl.Pages[3].OffsetFromTopOfDiv(divMgr2));
		}
Ejemplo n.º 10
0
		public void AdjustScrollRange_GrowFootnoteStream()
		{
			DummyVwLayoutStream stream = new DummyVwLayoutStream();
			DummyVwLayoutStream footnoteStream = new DummyVwLayoutStream();
			GoofyDivision divMgr = new GoofyDivision(stream);
			DummyPublication pubCtrl = new DummyPublication(null, divMgr, DateTime.Now);
			pubCtrl.PageHeight = 72000 * 6;
			divMgr.m_overrideHeight = divMgr.AvailablePageHeightInPrinterPixels;
			pubCtrl.CreatePages();
			Assert.AreEqual(2, pubCtrl.PageCount);
			divMgr.CallAddElement(pubCtrl.Pages[0], divMgr.m_overrideHeight - 100,
				1, 1, divMgr.InsideMarginInPrinterPixels, 20, divMgr.AvailablePageHeightInPrinterPixels);
			int origTopOfPageTwo = divMgr.m_overrideHeight - 100;
			((DummyPage)pubCtrl.Pages[0]).CallAddPageElement(divMgr, footnoteStream, false,
				new Rectangle(divMgr.InsideMarginInPrinterPixels, divMgr.m_overrideHeight - 100, divMgr.AvailablePageWidthInPrinterPixels, 100),
				0, false, 1, 1, 0, 100, false, true);
			divMgr.CallAddElement(pubCtrl.Pages[1], 100, 1, 1, divMgr.OutsideMarginInPrinterPixels,
				origTopOfPageTwo, divMgr.AvailablePageHeightInPrinterPixels);
			((DummyPage)pubCtrl.Pages[1]).CallAddPageElement(divMgr, footnoteStream, false,
				new Rectangle(divMgr.InsideMarginInPrinterPixels, divMgr.m_overrideHeight - 100, divMgr.AvailablePageWidthInPrinterPixels, 100),
				101, false, 1, 1, 0, 100, false, true);
			Point origScrollPos = pubCtrl.ScrollPosition;
			Size origScrollSize = pubCtrl.AutoScrollMinSize;
			pubCtrl.AdjustScrollRange(footnoteStream, 0, 0, 300, 95);
			Assert.AreEqual(2, pubCtrl.PageCount);
			Assert.AreEqual(origScrollPos, pubCtrl.ScrollPosition);
			Assert.AreEqual(origScrollSize, pubCtrl.AutoScrollMinSize);
			Assert.AreEqual(0, pubCtrl.Pages[0].PageElements[1].OffsetToTopPageBoundary);
			Assert.AreEqual(401, pubCtrl.Pages[1].PageElements[1].OffsetToTopPageBoundary);
			Assert.AreEqual(20, pubCtrl.Pages[0].OffsetFromTopOfDiv(divMgr));
			Assert.AreEqual(origTopOfPageTwo, pubCtrl.Pages[1].OffsetFromTopOfDiv(divMgr));
		}
Ejemplo n.º 11
0
		public void AdjustScrollRange_ShrinkFirstDivOnPage()
		{
			DummyVwLayoutStream stream = new DummyVwLayoutStream();
			GoofyDivision divMgr = new GoofyDivision(stream);
			DummyPublication pubCtrl = new DummyPublication(null, divMgr, DateTime.Now);
			pubCtrl.PageHeight = 72000 * 6;
			divMgr.m_overrideHeight = divMgr.AvailablePageHeightInPrinterPixels * 2;
			pubCtrl.CreatePages();
			Assert.AreEqual(3, pubCtrl.PageCount);
			Page pg1 = pubCtrl.Pages[0];
			Page pg2 = pubCtrl.Pages[1];
			Page pg3 = pubCtrl.Pages[2];
			divMgr.CallAddElement(pg1, divMgr.AvailablePageHeightInPrinterPixels - 20,
				1, 1, divMgr.InsideMarginInPrinterPixels, 20, divMgr.AvailablePageHeightInPrinterPixels);
			int origTopOfPageTwo = divMgr.AvailablePageHeightInPrinterPixels - 40;
			divMgr.CallAddElement(pg2, divMgr.AvailablePageHeightInPrinterPixels - 20,
				1, 1, divMgr.OutsideMarginInPrinterPixels, origTopOfPageTwo, divMgr.AvailablePageHeightInPrinterPixels);
			int origTopOfPageThree = divMgr.m_overrideHeight - 60;
			divMgr.CallAddElement(pg3, 40, 1, 1, divMgr.InsideMarginInPrinterPixels,
				origTopOfPageThree, divMgr.AvailablePageHeightInPrinterPixels);
			foreach (Page pg in pubCtrl.Pages)
				Assert.AreEqual(pg.PageElements[0].OffsetToTopPageBoundary, pg.OffsetFromTopOfDiv(divMgr));
			Point origScrollPos = pubCtrl.ScrollPosition;
			Size origScrollSize = pubCtrl.AutoScrollMinSize;
			// The following should cause the original page 2 to be deleted and adjust the top of
			// the original page 3 (now page 2) to be the same as the original top of page 2.
			pubCtrl.AdjustScrollRange(stream, 0, 0, -divMgr.AvailablePageHeightInPrinterPixels,
				origTopOfPageTwo - 2000);
			Assert.AreEqual(2, pubCtrl.PageCount);
			Assert.AreEqual(origScrollPos, pubCtrl.ScrollPosition);
			Assert.AreEqual(origScrollSize.Height * 2 / 3, pubCtrl.AutoScrollMinSize.Height);
			Assert.AreEqual(20, pg1.PageElements[0].OffsetToTopPageBoundary);
			Assert.AreEqual(pg3, pubCtrl.Pages[1]);
			Assert.AreEqual(origTopOfPageThree - divMgr.AvailablePageHeightInPrinterPixels,
				pg3.PageElements[0].OffsetToTopPageBoundary);
			Assert.AreEqual(40, pg3.PageElements[0].LocationOnPage.Height);
			Assert.IsFalse(pg1.NeedsLayout);
			Assert.IsTrue(pg3.NeedsLayout);
		}
Ejemplo n.º 12
0
		public void AdjustScrollRange_GrowFirstDivOnPage()
		{
			DummyVwLayoutStream stream = new DummyVwLayoutStream();
			GoofyDivision divMgr = new GoofyDivision(stream);
			DummyPublication pubCtrl = new DummyPublication(null, divMgr, DateTime.Now);
			pubCtrl.PageHeight = 72000 * 6;
			divMgr.m_overrideHeight = divMgr.AvailablePageHeightInPrinterPixels;
			pubCtrl.CreatePages();
			Assert.AreEqual(2, pubCtrl.PageCount);
			divMgr.CallAddElement(pubCtrl.Pages[0], divMgr.m_overrideHeight - 20,
				1, 1, divMgr.InsideMarginInPrinterPixels, 20, divMgr.AvailablePageHeightInPrinterPixels);
			int origTopOfPageTwo = divMgr.m_overrideHeight - 20;
			divMgr.CallAddElement(pubCtrl.Pages[1], 20, 1, 1, divMgr.OutsideMarginInPrinterPixels,
				origTopOfPageTwo, divMgr.AvailablePageHeightInPrinterPixels);
			Point origScrollPos = pubCtrl.ScrollPosition;
			Size origScrollSize = pubCtrl.AutoScrollMinSize;
			pubCtrl.AdjustScrollRange(stream, 0, 0, 300, origTopOfPageTwo - 2000);
			Assert.AreEqual(2, pubCtrl.PageCount);
			Assert.AreEqual(origScrollPos, pubCtrl.ScrollPosition);
			Assert.AreEqual(origScrollSize, pubCtrl.AutoScrollMinSize);
			Assert.AreEqual(20, pubCtrl.Pages[0].PageElements[0].OffsetToTopPageBoundary);
			Assert.AreEqual(origTopOfPageTwo + 300, pubCtrl.Pages[1].PageElements[0].OffsetToTopPageBoundary);
			Assert.IsFalse(pubCtrl.Pages[0].NeedsLayout);
			Assert.IsTrue(pubCtrl.Pages[1].NeedsLayout);
		}
Ejemplo n.º 13
0
		public void AdjustScrollRange_GrowFirstDivOnPage_NoElements()
		{
			DummyVwLayoutStream stream = new DummyVwLayoutStream();
			GoofyDivision divMgr = new GoofyDivision(stream);
			DummyPublication pubCtrl = new DummyPublication(null, divMgr, DateTime.Now);
			pubCtrl.PageHeight = 72000 * 6;
			divMgr.m_overrideHeight = divMgr.AvailablePageHeightInPrinterPixels;
			pubCtrl.CreatePages();
			Assert.AreEqual(2, pubCtrl.PageCount);
			Assert.AreEqual(0, pubCtrl.Pages[0].PageElements.Count);
			Assert.AreEqual(0, pubCtrl.Pages[1].PageElements.Count);
			Point origScrollPos = pubCtrl.ScrollPosition;
			Size origScrollSize = pubCtrl.AutoScrollMinSize;
			pubCtrl.AdjustScrollRange(stream, 0, 0, 300, 0);
			Assert.AreEqual(2, pubCtrl.PageCount);
			Assert.AreEqual(origScrollPos, pubCtrl.ScrollPosition);
			Assert.AreEqual(origScrollSize, pubCtrl.AutoScrollMinSize);
			Assert.AreEqual(0, pubCtrl.Pages[0].PageElements.Count);
			Assert.AreEqual(0, pubCtrl.Pages[1].PageElements.Count);
			Assert.IsTrue(pubCtrl.Pages[0].NeedsLayout);
			Assert.IsTrue(pubCtrl.Pages[1].NeedsLayout);
		}
Ejemplo n.º 14
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Configure a PublicationControl
		/// </summary>
		/// <param name="fAddSubStream">if set to <c>true</c> add subordinate stream.</param>
		/// <param name="fAddContent">if set to <c>true</c> add real content, otherwise add
		/// rectangle for paragraph.</param>
		/// ------------------------------------------------------------------------------------
		private void ConfigurePublication(bool fAddSubStream, bool fAddContent)
		{
			// When called for test setup, they will be null.
			// When called from within as test
			if (m_pub != null)
				m_pub.Dispose();
			if (m_division != null)
				m_division.Dispose();
			m_division = new DummyDivision(new DummyLazyPrintConfigurer(Cache, fAddSubStream,
				fAddContent), 2);
			IPublication pub =
				Cache.LangProject.TranslatedScriptureOA.PublicationsOC.ToArray()[0];
			m_pub = new DummyPublication(pub, m_division, DateTime.Now);
			m_pub.Configure();

			// Check initial state
			Assert.AreEqual(m_division, m_pub.Divisions[0]);
			Assert.IsNotNull(m_division.MainVc as DummyMainLazyViewVc);
			IVwLayoutStream layoutStream = m_division.MainLayoutStream;
			Assert.IsNotNull(layoutStream);
			m_pub.IsLeftBound = true;

			// Set up the publication
			m_pub.PageHeight = 72000 * 11; // 11 inches
			m_pub.PageWidth = (int)(72000 * 8.5); // 8.5 inches
			m_division.TopMargin = 36000; // Half inch
			m_division.BottomMargin = 18000; // Quarter inch
			m_division.InsideMargin = 9000; // 1/8 inch
			m_division.OutsideMargin = 4500; // 1/16 inch
			DummyMainLazyViewVc vc = m_division.MainVc as DummyMainLazyViewVc;
			vc.m_estBookHeight = 2000;
			vc.m_estSectionHeight = 2000;
			m_pub.Width = 3 * 96; // represents a window that is 3" wide at 96 DPI
		}
Ejemplo n.º 15
0
		public void GetLastElement_OneElement()
		{
			IVwLayoutStream stream = VwLayoutStreamClass.Create();
			using (DummyDivisionMgr division = new DummyDivisionMgr(stream, false))
			{
				using (DummyPublication dummyPub = new DummyPublication(null, division, DateTime.Now))
				{
					using (DummyPage page = new DummyPage(dummyPub))
					{
						PageElement element = new PageElement(division, stream, false,
							new Rectangle(720, 1440, (int)(6.5 * 720), (int)(9 * 1440)),
							0, true, 1, 1, 0, 9 * 1440, 0, false);
						page.PageElements.Add(element);

						int xd;
						PageElement lastElement = page.CallGetLastElement(division, out xd);
						Assert.AreEqual(element.LocationOnPage.Right, xd);
						Debug.WriteLine("GetLastElement_OneElement xd: " + xd);

						Assert.AreEqual(element, lastElement);
					}
				}
			}
		}
Ejemplo n.º 16
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Configure a PublicationControl
		/// </summary>
		/// <param name="fAddSubStream">if set to <c>true</c> add subordinate stream.</param>
		/// ------------------------------------------------------------------------------------
		private void ConfigurePublication(bool fAddSubStream)
		{
			// When called for test setup, they will be null.
			// When called from within as test
			if (m_pub != null)
				m_pub.Dispose();
			if (m_division != null)
				m_division.Dispose();
			m_division = new DummyDivision(new DummyLazyPrintConfigurer(Cache, fAddSubStream), 1);
			Publication pub = new Publication(Cache,
				Cache.LangProject.TranslatedScriptureOA.PublicationsOC.HvoArray[0]);
			m_pub = new DummyPublication(pub, m_division, DateTime.Now);
			m_pub.Configure();

			// Check initial state
			Assert.AreEqual(m_division, m_pub.Divisions[0]);
			Assert.IsNotNull(m_division.MainVc as DummyMainLazyViewVc);
			IVwLayoutStream layoutStream = m_division.MainLayoutStream;
			Assert.IsNotNull(layoutStream);
			m_pub.IsLeftBound = true;
		}
Ejemplo n.º 17
0
		public virtual void TearDown()
		{
			if (m_fdoCache != null)
			{
				UndoResult ures = 0;
				while (m_fdoCache.CanUndo)
				{
					m_fdoCache.Undo(out ures);
					if (ures == UndoResult.kuresFailed || ures == UndoResult.kuresError)
						Assert.Fail("ures should not be == " + ures.ToString());
				}
			}
			if (m_firstDivision != null)
			{
				m_firstDivision.m_hPagesBroken.Clear();
				m_firstDivision.Dispose();
				m_firstDivision = null;
			}

			// Make sure we close all the rootboxes
			if (m_pub != null)
			{
				m_pub.Dispose();
				m_pub = null;
			}

			m_subStream = null;
		}