Пример #1
0
        public void Int64Prop()
        {
            long valNew = m_ISilDataAccess.get_Int64Prop(1114, 2224);

            Assert.AreEqual(0, valNew);

            m_IVwCacheDa.CacheInt64Prop(1114, 2224, long.MaxValue);
            valNew = m_ISilDataAccess.get_Int64Prop(1114, 2224);
            Assert.AreEqual(long.MaxValue, valNew);

            m_IVwCacheDa.CacheInt64Prop(1114, 2224, long.MinValue);
            valNew = m_ISilDataAccess.get_Int64Prop(1114, 2224);
            Assert.AreEqual(long.MinValue, valNew);
        }
Пример #2
0
        public void Int64Prop()
        {
            CheckDisposed();
            long valNew = m_ISilDataAccess.get_Int64Prop(1114, 2224);

            Assert.AreEqual(0, valNew);
            Assert.IsFalse(m_ISilDataAccess.IsDirty());

            m_ISilDataAccess.SetInt64(1114, 2224, long.MaxValue);
            valNew = m_ISilDataAccess.get_Int64Prop(1114, 2224);
            Assert.AreEqual(long.MaxValue, valNew);
            Assert.IsTrue(m_ISilDataAccess.IsDirty());

            m_ISilDataAccess.SetInt64(1114, 2224, long.MinValue);
            valNew = m_ISilDataAccess.get_Int64Prop(1114, 2224);
            Assert.AreEqual(long.MinValue, valNew);
            Assert.IsTrue(m_ISilDataAccess.IsDirty());

            CheckProp(1114, 2224, long.MinValue, CellarModuleDefns.kcptTime);
        }
Пример #3
0
        /// <summary>
        /// Record the current parse timestamp of a whole collection of StTexts
        /// Equivalent to calling RecordParseTimestamp on each of them.
        /// </summary>
        /// <param name="texts"></param>
        public static void RecordParseTimestamps(List <IStText> texts)
        {
            if (texts.Count == 0)
            {
                return;
            }
            FdoCache cache = texts[0].Cache;

            int[] targetHvos = new int[texts.Count];
            for (int i = 0; i < targetHvos.Length; i++)
            {
                targetHvos[i] = texts[i].Hvo;
            }
            int    index       = 0;
            string Hvos        = DbOps.MakePartialIdList(ref index, targetHvos);
            string whereClause = "";

            if (index == targetHvos.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$, max(UpdStmp) from StTxtPara_ " + whereClause + " group by owner$";
            IDbColSpec dcs = DbColSpecClass.Create();

            dcs.Push((int)DbColType.koctBaseId, 0, 0, 0);
            int modifyTimestampTag = ParagraphsModifiedTimestampTag(cache);

            dcs.Push((int)DbColType.koctInt64, 1, modifyTimestampTag, 0);
            cache.VwOleDbDaAccessor.Load(sql, dcs, 0, 0, null, false);

            ISilDataAccess sda = cache.MainCacheAccessor;

            foreach (StText text in texts)
            {
                // Much of the logic of RecordParseTimestamp, but can assume modify timestamp is already loaded.
                text.LastParsedTimestamp = sda.get_Int64Prop(text.Hvo, modifyTimestampTag);
                text.ClearLastModifiedTimestamp();
            }
        }
Пример #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="hvo"></param>
 /// <param name="tag"></param>
 /// <returns></returns>
 public long get_Int64Prop(int hvo, int tag)
 {
     return(m_sda.get_Int64Prop(hvo, tag));
 }
Пример #5
0
 /// <summary>
 /// Get the value of a 64bit integer property (often actually a time).
 /// 0 if no value known for this property.
 /// ENHANCE JohnT: shouldn't it also return S_FALSE?
 ///</summary>
 /// <param name='hvo'> </param>
 /// <param name='tag'> </param>
 /// <returns></returns>
 public virtual long get_Int64Prop(int hvo, int tag)
 {
     return(m_baseSda.get_Int64Prop(hvo, tag));
 }