当前位置: 首页>>代码示例>>C#>>正文


C# FdoCache.LoadAllOfAnOwningVectorProp方法代码示例

本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.LoadAllOfAnOwningVectorProp方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.LoadAllOfAnOwningVectorProp方法的具体用法?C# FdoCache.LoadAllOfAnOwningVectorProp怎么用?C# FdoCache.LoadAllOfAnOwningVectorProp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SIL.FieldWorks.FDO.FdoCache的用法示例。


在下文中一共展示了FdoCache.LoadAllOfAnOwningVectorProp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PreloadData

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Preloads the data used by TE.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="splashScreen">The splash screen (can be null).</param>
		/// ------------------------------------------------------------------------------------
		public static void PreloadData(FdoCache cache, IFwSplashScreen splashScreen)
		{
			if (splashScreen != null)
			{
				splashScreen.ProgressBar.SetRange(0, 21); // we call 21 x UpdateProgress() below
				splashScreen.ProgressBar.StepSize = 1;
				splashScreen.ProgressBar.Position = 0;
			}

			// Preload all vectors for scripture
			// NOTE: splitting up the loading of flids off of the same object type (e.g. StText)
			// lets us create a smoother progress bar and doesn't seem to produce any noticable
			// performance hit!
			cache.PreloadIfMissing(cache.LangProject.TranslatedScriptureOAHvo,
				(int)Scripture.ScriptureTags.kflidScriptureBooks, 0);
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningVectorProp((int)ScrBook.ScrBookTags.kflidSections, "ScrBook");
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningVectorProp((int)Scripture.ScriptureTags.kflidStyles, "Scripture");
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningAtomicProp((int)ScrSection.ScrSectionTags.kflidHeading, "ScrSection");
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningAtomicProp((int)ScrSection.ScrSectionTags.kflidContent, "ScrSection");
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningVectorProp((int)StText.StTextTags.kflidParagraphs, "StText",
				new int[] { (int)ScrBook.ScrBookTags.kflidFootnotes });
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningVectorProp((int)StText.StTextTags.kflidParagraphs, "StText",
				new int[] { (int)ScrBook.ScrBookTags.kflidTitle });
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningVectorProp((int)StText.StTextTags.kflidParagraphs, "StText",
				new int[] { (int)ScrSection.ScrSectionTags.kflidHeading });
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningVectorProp((int)StText.StTextTags.kflidParagraphs, "StText",
				new int[] { (int)ScrSection.ScrSectionTags.kflidContent });
			UpdateProgress(splashScreen);
			cache.LoadAllOfAnOwningVectorProp((int)StTxtPara.StTxtParaTags.kflidTranslations, "StTxtPara");
			UpdateProgress(splashScreen);

			// also preload all scripture, sections, paragraphs and footnotes
			CmObject.LoadDataForFlids(typeof(Scripture), cache, null,
				LangProject.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(StStyle), cache,
				new int[] { (int)LangProject.LangProjectTags.kflidTranslatedScripture },
				Scripture.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(ScrSection), cache,
				new int[] { (int)Scripture.ScriptureTags.kflidScriptureBooks },
				ScrBook.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(StFootnote), cache,
				new int[] { (int)Scripture.ScriptureTags.kflidScriptureBooks },
				ScrBook.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(StTxtPara), cache,
				new int[] { (int)ScrBook.ScrBookTags.kflidFootnotes }, StText.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(StTxtPara), cache,
				new int[] { (int)ScrBook.ScrBookTags.kflidTitle }, StText.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(StTxtPara), cache,
				new int[] { (int)ScrSection.ScrSectionTags.kflidHeading }, StText.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(StTxtPara), cache,
				new int[] { (int)ScrSection.ScrSectionTags.kflidContent }, StText.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(CmTranslation), cache,
				new int[] { (int)CmTranslation.CmTranslationTags.kflidStatus }, CmTranslation.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(CmTranslation), cache,
				new int[] { (int)CmTranslation.CmTranslationTags.kflidTranslation }, CmTranslation.FullViewName);
			UpdateProgress(splashScreen);
			CmObject.LoadDataForFlids(typeof(CmTranslation), cache,
				new int[] { (int)CmTranslation.CmTranslationTags.kflidType }, CmTranslation.FullViewName);
			UpdateProgress(splashScreen);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:84,代码来源:TeScrInitializer.cs

示例2: ConcordTexts

		/// <summary>
		/// Parse through all the given texts, even if they've been fully analyzed.
		/// Collect occurrences of words and cache all paragraph and wordform related virtual properties.
		/// </summary>
		/// <param name="cache"></param>
		/// <param name="hvosStText">list of hvos for StText objects</param>
		public static void ConcordTexts(FdoCache cache, int[] hvosStText, ProgressState progress)
		{
			if (progress == null)
				progress = new NullProgressState();
			using (ParagraphParser pp = new ParagraphParser(cache))
			{
#if PROFILING
				long ticks = DateTime.Now.Ticks;
#endif
				// Ensure all info about paragraphs of texts and contents of paragraphs is in cache and current.
				// Enhance JohnT: possibly performance would be helped, especially in cases where we have a lot
				// of archived Scripture versions, by restricting this to just the texts in hvosStText.
				cache.LoadAllOfAnOwningVectorProp((int)StText.StTextTags.kflidParagraphs, "StText");
				cache.LoadAllOfAStringProp((int)StTxtPara.StTxtParaTags.kflidContents);
#if PROFILING
				Debug.WriteLine("Time to end of loading text data = " + (DateTime.Now.Ticks - ticks));
#endif
				pp.m_hvosStText = hvosStText;
				//// Get a list of all the paragraphs.
				//List<int> targetParagraphs = new List<int>();
				//foreach (IStText text in new FdoObjectSet<IStText>(cache, pp.m_hvosStText, true))
				//{
				//    targetParagraphs.AddRange(text.ParagraphsOS.HvoArray);
				//}

				pp.RebuildingConcordanceWordforms = true;
				WordformInventory wfi =	(cache.LangProject.WordformInventoryOA as WordformInventory);
				wfi.ResetConcordanceWordformsAndOccurrences();

#if PROFILING
				Debug.WriteLine("Time to end of reset occurrenes = " + (DateTime.Now.Ticks - ticks));
#endif

				ParagraphParser.ResetParseSessionDependentStaticData();

				// Estimate the number of total number of milestones we'll set.
				// Enhance: we could construct a way to set percentage done based upon
				// number of texts and paragraphs in each text.
				if (progress is MilestoneProgressState)
				{
					MilestoneProgressState mp = progress as SIL.FieldWorks.Common.Controls.MilestoneProgressState;
					for (int i = 0; i < pp.m_hvosStText.Length; ++i)
					{
						AddParseTextMilestones(mp);
					}
				}

				// Parse each text to load our paragraph and wordform segment annotations.
				using (SuppressSubTasks suppressor = new SuppressSubTasks(cache, true))
				{
					List<IStText> texts = new List<IStText>(new FdoObjectSet<IStText>(cache, pp.m_hvosStText, false));
					// Anything like this is currently redundant, we loaded the contents of ALL paragraphs above.
					//List<IStText> parsedTexts = texts.FindAll(HasLastParsedTimestamp);
					//if (parsedTexts.Count != 0)
					//{
					//    // We actually have parsed some texts before...yet we have to again. Possibly another program changed
					//    // the data. Reload it as efficiently as possible.
					//    int[] parsedHvos = new int[parsedTexts.Count];
					//    for (int i = 0; i < parsedHvos.Length; i++)
					//        parsedHvos[i] = parsedTexts[i].Hvo;
					//    int index = 0;
					//    string Hvos = DbOps.MakePartialIdList(ref index, parsedHvos);
					//    string whereClause = "";
					//    if (index == parsedHvos.Length)
					//    {
					//        // If we can make a single where clause we'll do it; otherwise do them all
					//        whereClause = " where Owner$ in (" + Hvos + ")";
					//    }
					//    string sql = "select Owner$, Id, UpdStmp, Contents, Contents_Fmt from StTxtPara_ " + whereClause + " order by owner$, OwnOrd$";
					//    IDbColSpec dcs = DbColSpecClass.Create();
					//    dcs.Push((int)DbColType.koctBaseId, 0, 0, 0);
					//    dcs.Push((int)DbColType.koctObjVecOwn, 1, (int)StText.StTextTags.kflidParagraphs, 0);
					//    dcs.Push((int)DbColType.koctTimeStamp, 2, 0, 0);
					//    dcs.Push((int)DbColType.koctString, 2, (int)StTxtPara.StTxtParaTags.kflidContents, 0);
					//    dcs.Push((int)DbColType.koctFmt, 2, (int)StTxtPara.StTxtParaTags.kflidContents, 0);
					//    cache.VwOleDbDaAccessor.Load(sql, dcs, 0, 0, null, false);
					//}

					// Need a separate loop for these, otherwise things get confused as we start to reuse
					// annotations in pp.Parse() and then re-encounter them in later attempts to salvage Pfics and segments.
#if PROFILING
					Debug.WriteLine("Time to end of preliminaries = " + (DateTime.Now.Ticks - ticks));
#endif
					foreach (IStText text in texts)
						pp.SalvageDummyAnnotations(text);
#if PROFILING
					Debug.WriteLine("Time to start of main parse loop = " + (DateTime.Now.Ticks - ticks));
#endif
					foreach (IStText text in texts)
					{
						pp.Parse(text, progress);
					}
#if PROFILING
					Debug.WriteLine("Time to end of main parse loop = " + (DateTime.Now.Ticks - ticks));
//.........这里部分代码省略.........
开发者ID:sillsdev,项目名称:WorldPad,代码行数:101,代码来源:ITextUtils.cs


注:本文中的SIL.FieldWorks.FDO.FdoCache.LoadAllOfAnOwningVectorProp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。