SIL.FieldWorks.CacheLight.RealDataCache.get_MultiStringAlt C# (CSharp) Method

get_MultiStringAlt() public method

Member get_MultiStringAlt
ISilDataAccess method
public get_MultiStringAlt ( int hvo, int tag, int ws ) : ITsString
hvo int hvo
tag int tag
ws int ws
return ITsString
		public ITsString get_MultiStringAlt(int hvo, int tag, int ws)
		{
			CheckDisposed();

			CheckBasics(hvo);

			var key = new HvoFlidWSKey(hvo, tag, ws);
			var removeFromCache = false;
			if (!m_extendedKeyCache.ContainsKey(key))
				removeFromCache = CheckForVirtual(hvo, tag);
			var tss = m_extendedKeyCache[key];
			if (tss == null)
			{
				// Note: Normally, this would throw a KeyNotFoundException,
				// but the interface says we have to return an empty string.
				var tsf = TsStrFactoryClass.Create();
				tss = tsf.MakeString(string.Empty, ws);
				// If it is not a Compute every time virtual, go ahead and cache it
				if (!removeFromCache)
					SetMultiStringAlt(hvo, tag, ws, tss); // Save it for next time.
			}
			if (removeFromCache)
				m_extendedKeyCache.Remove(key);
			return tss;
		}