/// <summary>Member get_MultiStringAlt</summary> /// <param name='hvo'>hvo</param> /// <param name='tag'>tag</param> /// <param name='ws'>ws</param> /// <returns>A ITsString</returns> /// <remarks>ISilDataAccess method</remarks> 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; }
/// <summary>Member get_IsPropInCache</summary> /// <param name='hvo'>hvo</param> /// <param name='tag'>tag</param> /// <param name='cpt'>cpt</param> /// <param name='ws'>ws</param> /// <returns>A System.Boolean</returns> public bool get_IsPropInCache(int hvo, int tag, int cpt, int ws) { CheckDisposed(); var key = new HvoFlidKey(hvo, tag); var keyWs = new HvoFlidWSKey(hvo, tag, ws); switch ((CellarPropertyType)cpt) { default: throw new ArgumentException("Invalid field type (cpt)."); case CellarPropertyType.Boolean: return m_boolCache.ContainsKey(key); case CellarPropertyType.Integer: return m_intCache.ContainsKey(key); case CellarPropertyType.Numeric: return false; // m_intCache.ContainsKey(key); case CellarPropertyType.Float: return false; // m_intCache.ContainsKey(key); case CellarPropertyType.Time: return m_longCache.ContainsKey(key); case CellarPropertyType.Guid: return m_guidCache.ContainsKey(key); case CellarPropertyType.Image: return false; // m_intCache.ContainsKey(key); case CellarPropertyType.GenDate: return false; // m_intCache.ContainsKey(key); case CellarPropertyType.Binary: return false; case CellarPropertyType.String: return m_basicITsStringCache.ContainsKey(key); case CellarPropertyType.MultiUnicode: // Fall through. case CellarPropertyType.MultiString: return m_extendedKeyCache.ContainsKey(keyWs); case CellarPropertyType.Unicode: return m_basicStringCache.ContainsKey(key); case CellarPropertyType.OwningAtomic: return m_intCache.ContainsKey(key); case CellarPropertyType.ReferenceAtomic: return m_intCache.ContainsKey(key); case CellarPropertyType.OwningCollection: case CellarPropertyType.ReferenceCollection: case CellarPropertyType.OwningSequence: case CellarPropertyType.ReferenceSequence: return m_vectorCache.ContainsKey(key); } }
/// <summary>Member get_IsPropInCache</summary> /// <param name='hvo'>hvo</param> /// <param name='tag'>tag</param> /// <param name='cpt'>cpt</param> /// <param name='ws'>ws</param> /// <returns>A System.Boolean</returns> public bool get_IsPropInCache(int hvo, int tag, int cpt, int ws) { CheckDisposed(); HvoFlidKey key = new HvoFlidKey(hvo, (uint)tag); HvoFlidWSKey keyWs = new HvoFlidWSKey(hvo, (uint)tag, ws); switch (cpt) { default: throw new ArgumentException("Invalid field type (cpt)."); case (int)CellarModuleDefns.kcptBoolean: return m_boolCache.ContainsKey(key); case (int)CellarModuleDefns.kcptInteger: return m_intCache.ContainsKey(key); case (int)CellarModuleDefns.kcptNumeric: return false; // m_intCache.ContainsKey(key); case (int)CellarModuleDefns.kcptFloat: return false; // m_intCache.ContainsKey(key); case (int)CellarModuleDefns.kcptTime: return m_longCache.ContainsKey(key); case (int)CellarModuleDefns.kcptGuid: return m_guidCache.ContainsKey(key); case (int)CellarModuleDefns.kcptImage: return false; // m_intCache.ContainsKey(key); case (int)CellarModuleDefns.kcptGenDate: return false; // m_intCache.ContainsKey(key); case (int)CellarModuleDefns.kcptBinary: return false; case (int)CellarModuleDefns.kcptString: // Fall through. case (int)CellarModuleDefns.kcptBigString: return m_basicITsStringCache.ContainsKey(key); case (int)CellarModuleDefns.kcptMultiUnicode: // Fall through. case (int)CellarModuleDefns.kcptMultiBigUnicode: // Fall through. case (int)CellarModuleDefns.kcptMultiString: // Fall through. case (int)CellarModuleDefns.kcptMultiBigString: return m_extendedKeyCache.ContainsKey(keyWs); case (int)CellarModuleDefns.kcptUnicode: // Fall through. case (int)CellarModuleDefns.kcptBigUnicode: return m_basicStringCache.ContainsKey(key); case (int)CellarModuleDefns.kcptOwningAtom: return m_intCache.ContainsKey(key); case (int)CellarModuleDefns.kcptReferenceAtom: return m_intCache.ContainsKey(key); case (int)CellarModuleDefns.kcptOwningCollection: case (int)CellarModuleDefns.kcptReferenceCollection: case (int)CellarModuleDefns.kcptOwningSequence: case (int)CellarModuleDefns.kcptReferenceSequence: return m_vectorCache.ContainsKey(key); } }