SIL.FieldWorks.IText.ConcordanceControl.UpdateConcordanceForGramInfo C# (CSharp) Method

UpdateConcordanceForGramInfo() private method

In the concordance the user selects the Lex Gram Info line along with a particular part of speech. This method finds each Wordform analysis with a morpheme that has the part of speech matching the selected part of speech.
private UpdateConcordanceForGramInfo ( int ws ) : List
ws int
return List
		private List<IParaFragment> UpdateConcordanceForGramInfo(int ws)
		{
			// Find analyses that have the relevant morpheme.
			var analyses = new HashSet<IAnalysis>();
			var hvoPossToMatch = GetHvoOfListItemToMatch(ws);
			foreach (var mb in m_cache.ServiceLocator.GetInstance<IWfiMorphBundleRepository>().AllInstances())
			{
				if (mb.MsaRA != null && mb.MsaRA.ComponentsRS != null)
				{
					var myHvos = GetHvoOfMsaPartOfSpeech(mb.MsaRA);
					if (myHvos.Contains(hvoPossToMatch))
					{
						analyses.Add(mb.Owner as IWfiAnalysis);
					}
				}
			}
			return GetOccurrencesOfAnalyses(analyses);
		}