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


C# Set.SymmetricDifference方法代码示例

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


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

示例1: LoadTextTagsForXfics

		/// <summary>
		///
		/// </summary>
		/// <param name="xfics"></param>
		internal void LoadTextTagsForXfics(List<int> xfics)
		{
			List<int> textTagList = InterlinTaggingChild.GetTaggingReferencingTheseAnnotations(Cache, xfics, m_textTagAnnDefn);
			Set<int> xficsTagged = new Set<int>();
			foreach (int hvoTag in textTagList)
				xficsTagged.AddRange(CacheTagString(hvoTag)); // Preload doesn't need PropChanged() to fire. This version doesn't.
			// now go through the list of xfics that didn't have tags cached, and make sure they have empty strings cached
			Set<int> xficsWithoutTags = xficsTagged.SymmetricDifference(xfics);
			CacheNullTagString(xficsWithoutTags.ToArray(), false);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:14,代码来源:InterlinTaggingChild.cs

示例2: LoadDataForTextTags

		/// <summary>
		/// Given a segment (for which we should have just loaded the wordforms), load any associated text tagging data
		/// </summary>
		/// <param name="hvoSeg"></param>
		private void LoadDataForTextTags(int hvoSeg)
		{
			// Get a 'real' Segment
			ISegment curSeg;
			try
			{
				curSeg = m_segRepository.GetObject(hvoSeg);
				if (curSeg.AnalysesRS == null || curSeg.AnalysesRS.Count == 0)
					return; // small sanity check
			}
			catch (KeyNotFoundException)
			{
				return; // Hmm... this could be a problem, but we'll just skip it for now.
			}

			// Get all AnalysisOccurrences in this Segment
				// Resharper says the following LINQ is equivalent. OK, I guess!
					//var segWords = new List<AnalysisOccurrence>();
					//for (int i = 0; i < curSeg.AnalysesRS.Count; i++)
					//	segWords.Add(new AnalysisOccurrence(curSeg, i));
			var segWords = curSeg.AnalysesRS.Select((t, i) => new AnalysisOccurrence(curSeg, i)).ToList();

			// Find all the tags for this Segment's AnalysisOccurrences and cache them
			var textTagList = InterlinTaggingChild.GetTaggingReferencingTheseWords(segWords);
			var occurrencesTagged = new Set<AnalysisOccurrence>();
			foreach (var tag in textTagList)
			{
				occurrencesTagged.AddRange(tag.GetOccurrences());
				CacheTagString(tag);
			}

			// now go through the list of occurrences that didn't have tags cached, and make sure they have empty strings cached
			var occurrencesWithoutTags = occurrencesTagged.SymmetricDifference(segWords);
			if (occurrencesWithoutTags != null) CacheNullTagString(occurrencesWithoutTags);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:39,代码来源:InterlinTaggingChild.cs


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