Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ws">The ws.</param>
        protected override void OnChangeNotifySharedStore(WritingSystemDefinition ws)
        {
            base.OnChangeNotifySharedStore(ws);

            if (m_globalStore != null)
            {
                WritingSystemDefinition globalWs;
                if (m_globalStore.TryGet(ws.Id, out globalWs))
                {
                    if (ws.DateModified > globalWs.DateModified)
                    {
                        WritingSystemDefinition newWs = ws.Clone();
                        newWs.Modified = true;
                        try
                        {
                            m_globalStore.Remove(ws.Id);
                            m_globalStore.Set(newWs);
                        }
                        catch (UnauthorizedAccessException)
                        {
                            // Live with it if we can't update the global store. In a CS world we might
                            // well not have permission.
                        }
                    }
                }

                else
                {
                    m_globalStore.Set(ws.Clone());
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Sets the specified writing system.
        /// </summary>
        /// <param name="ws">The writing system.</param>
        public void Set(IWritingSystem ws)
        {
            var palasoWs = (PalasoWritingSystem)ws;

            lock (m_syncRoot)
            {
                m_localStore.Set(palasoWs);
                palasoWs.WritingSystemManager = this;
                palasoWs.Handle = m_nextHandle++;
                m_handleWss[palasoWs.Handle] = palasoWs;
            }
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ws">The ws.</param>
        protected override void OnChangeNotifySharedStore(IWritingSystemDefinition ws)
        {
            base.OnChangeNotifySharedStore(ws);

            if (m_globalStore != null)
            {
                if (m_globalStore.Contains(ws.Id))
                {
                    if (ws.DateModified > m_globalStore.Get(ws.Id).DateModified)
                    {
                        WritingSystemDefinition newWs = ws.Clone();
                        newWs.Modified = true;
                        m_globalStore.Remove(ws.Id);
                        m_globalStore.Set(newWs);
                    }
                }

                else
                {
                    m_globalStore.Set(ws.Clone());
                }
            }
        }