/// <summary>
        ///
        /// </summary>
        /// <param name="ws">The ws.</param>
        protected override void OnChangeNotifySharedStore(IWritingSystemDefinition ws)
        {
            base.OnChangeNotifySharedStore(ws);

            if (m_globalStore != null)
            {
                IWritingSystemDefinition globalWs;
                if (m_globalStore.TryGet(ws.Id, out globalWs))
                {
                    if (ws.DateModified > globalWs.DateModified)
                    {
                        WritingSystemDefinition newWs = ws.Clone();
                        newWs.Modified = true;                         // ensure any existing file for this WS is overwritten
                        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());
                }
            }
        }
示例#2
0
 public IWritingSystemDefinition MakeDuplicate(IWritingSystemDefinition definition)
 {
     if (definition == null)
     {
         throw new ArgumentNullException("definition");
     }
     return(definition.Clone());
 }
示例#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());
                }
            }
        }
		/// <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());
				}
			}
		}
		public IWritingSystemDefinition MakeDuplicate(IWritingSystemDefinition definition)
		{
			if (definition == null)
			{
				throw new ArgumentNullException("definition");
			}
			return definition.Clone();
		}
		/// <summary>
		/// Makes a duplicate of an existing writing system definition.  Set will need
		/// to be called with this new duplicate once identifying information has been changed
		/// in order to place the new definition in the store.
		/// </summary>
		public IWritingSystemDefinition MakeDuplicate(IWritingSystemDefinition definition)
		{
			return definition.Clone();
		}
		public DialectSuggestion(IWritingSystemDefinition primary)
		{
			_templateDefinition = primary.Clone();
			this.Label = string.Format("new dialect of {0}", _templateDefinition.LanguageName);
		}
		public VoiceSuggestion(IWritingSystemDefinition primary)
		{
			_templateDefinition = primary.Clone();
			_templateDefinition.IsVoice = true;
			SetLabelDetail("voice");
		}
		/// <summary>
		///
		/// </summary>
		/// <param name="ws">The ws.</param>
		protected override void OnChangeNotifySharedStore(IWritingSystemDefinition ws)
		{
			base.OnChangeNotifySharedStore(ws);

			if (m_globalStore != null)
			{
				IWritingSystemDefinition globalWs;
				if (m_globalStore.TryGet(ws.Id, out globalWs))
				{
					if (ws.DateModified > globalWs.DateModified)
					{
						WritingSystemDefinition newWs = ws.Clone();
						newWs.Modified = true; // ensure any existing file for this WS is overwritten
						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());
				}
			}
		}
示例#10
0
 public DialectSuggestion(IWritingSystemDefinition primary)
 {
     _templateDefinition = primary.Clone();
     this.Label          = string.Format("new dialect of {0}", _templateDefinition.LanguageName);
 }
示例#11
0
 public VoiceSuggestion(IWritingSystemDefinition primary)
 {
     _templateDefinition         = primary.Clone();
     _templateDefinition.IsVoice = true;
     SetLabelDetail("voice");
 }
示例#12
0
 /// <summary>
 /// Makes a duplicate of an existing writing system definition.  Set will need
 /// to be called with this new duplicate once identifying information has been changed
 /// in order to place the new definition in the store.
 /// </summary>
 public IWritingSystemDefinition MakeDuplicate(IWritingSystemDefinition definition)
 {
     return(definition.Clone());
 }