예제 #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes Scripture for testing.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void FixtureSetup()
		{
			base.FixtureSetup();

			ScrReferenceTests.InitializeScrReferenceForTests();
			m_lp = Cache.LanguageProject;
			m_repoScrBook = Cache.ServiceLocator.GetInstance<IScrBookRepository>();
			m_repoScrSection = Cache.ServiceLocator.GetInstance<IScrSectionRepository>();
			m_repoStTxtPara = Cache.ServiceLocator.GetInstance<IScrTxtParaRepository>();
			IWritingSystem temp;
			Cache.ServiceLocator.WritingSystemManager.GetOrSet("en", out temp);
			m_wsEn = temp.Handle;
			Cache.ServiceLocator.WritingSystemManager.GetOrSet("de", out temp);
			m_wsDe = temp.Handle;

			NonUndoableUnitOfWorkHelper.Do(m_actionHandler, () =>
			{
				// The following has the side-effect of creating and initializing the ScrRefSystem
				m_scr = m_lp.TranslatedScriptureOA = Cache.ServiceLocator.GetInstance<IScriptureFactory>().Create();
				CreateStandardScriptureStyles();
				InitializeScrAnnotationCategories();
			});
		}
예제 #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="TeEditingHelper"/> class.
		/// </summary>
		/// <param name="callbacks">The callbacks.</param>
		/// <param name="cache">The cache.</param>
		/// <param name="filterInstance">The filter instance.</param>
		/// <param name="viewType">Type of the view.</param>
		/// <param name="app">The app.</param>
		/// ------------------------------------------------------------------------------------
		public TeEditingHelper(IEditingCallbacks callbacks, FdoCache cache, int filterInstance,
			TeViewType viewType, IApp app)
			: base(cache, callbacks)
		{
			if (m_cache == null)
				throw new ArgumentNullException("cache");

			m_scr = m_cache.LangProject.TranslatedScriptureOA;
			m_app = app;

			IFdoServiceLocator servloc = m_cache.ServiceLocator;
			m_repoStText = servloc.GetInstance<IStTextRepository>();
			m_repoScrTxtPara = servloc.GetInstance<IScrTxtParaRepository>();
			m_repoScrBook = servloc.GetInstance<IScrBookRepository>();
			m_repoScrSection = servloc.GetInstance<IScrSectionRepository>();
			m_repoScrFootnote = servloc.GetInstance<IScrFootnoteRepository>();
			m_repoCmTrans = servloc.GetInstance<ICmTranslationRepository>();
			m_wsContainer = servloc.WritingSystems;
			m_repoCmObject = servloc.GetInstance<ICmObjectRepository>();
			m_repoSegment = servloc.GetInstance<ISegmentRepository>();

			m_viewType = viewType;
			m_filterInstance = filterInstance;
			PasteFixTssEvent += RemoveHardFormatting;
		}