Example #1
0
        /// <summary>
        /// Handle a change by adding a record to the database (only if the
        /// change does not arise directly out of processing a sync record from elsewhere).
        /// </summary>
        /// <param name="hvo"></param>
        /// <param name="tag"></param>
        /// <param name="ivMin"></param>
        /// <param name="cvIns"></param>
        /// <param name="cvDel"></param>
        public void PropChanged(int hvo, int tag, int ivMin, int cvIns, int cvDel)
        {
            CheckDisposed();
            if (hvo == m_hvoIgnore && tag == m_flidIgnore)
            {
                return;
            }
            if (tag < 0)
            {
                return;                 // common for fake properties
            }
            // If it's a virtual property we don't want to make a sync record.
            IVwCacheDa        cda = m_cache.MainCacheAccessor as IVwCacheDa;
            IVwVirtualHandler vh  = cda.GetVirtualHandlerId(tag);

            if (vh != null)
            {
                return;
            }
            // (CLE-76) Topics List Editor needs to be sync'd with the database when
            // we make certain changes to possibility lists, especially structural ones
            // like adding/removing/moving/promoting possibilities. The simplest thing
            // to do for now, is to indicate a full refresh is needed when any of these
            // properties are being altered (even if it turns out to be minor).
            SyncMsg msg = SyncMsg.ksyncSimpleEdit;

            if (tag == (int)CmPossibility.CmPossibilityTags.kflidName ||
                tag == (int)CmPossibility.CmPossibilityTags.kflidAbbreviation ||
                tag == (int)CmPossibilityList.CmPossibilityListTags.kflidPossibilities ||
                tag == (int)CmPossibility.CmPossibilityTags.kflidSubPossibilities)
            {
                // NOTE: assume that apps that watch for ksyncFullRefresh will only
                // refresh once, and not multiple times if multiple refreshes get posted.
                // This is how Topic List Editor currently behaves.
                msg = SyncMsg.ksyncFullRefresh;
            }
            m_cache.StoreSync(m_appGuid, new SyncInfo(msg, hvo, tag));
        }