SIL.CoreImpl.PalasoWritingSystemManager.Exists C# (CSharp) Method

Exists() public method

Determines if a writing system exists with the specified handle.
public Exists ( int handle ) : bool
handle int The handle.
return bool
		public bool Exists(int handle)
		{
			lock (m_syncRoot)
				return m_handleWss.ContainsKey(handle);
		}

Same methods

PalasoWritingSystemManager::Exists ( string identifier ) : bool

Usage Example

        public void SerializeDeserialize()
        {
            string storePath = PrepareTempStore("Store");

            // serialize
            var wsManager = new PalasoWritingSystemManager(new LocalFileWritingSystemStore(storePath));
            var ws        = wsManager.Set("en-US");

            ws.SpellCheckingId = "en-US";
            ws.MatchedPairs    = "matched pairs";
            ws.LCID            = 0x409;
            ws.ValidChars      = "valid characters";
            ws.LegacyMapping   = "legacy mapping";
            wsManager.Save();

            // deserialize
            wsManager = new PalasoWritingSystemManager(new LocalFileWritingSystemStore(storePath));
            Assert.IsTrue(wsManager.Exists("en-US"));
            ws = wsManager.Get("en-US");
            Assert.AreEqual("Eng", ws.Abbreviation);
            Assert.AreEqual("English", ws.LanguageSubtag.Name);
            Assert.AreEqual("en-US", ws.SpellCheckingId);
            Assert.AreEqual("United States", ws.RegionSubtag.Name);
            Assert.AreEqual("matched pairs", ws.MatchedPairs);
            Assert.AreEqual(0x409, ws.LCID);
            Assert.AreEqual("valid characters", ws.ValidChars);
            Assert.AreEqual("legacy mapping", ws.LegacyMapping);
            Assert.AreEqual("eng", ws.ISO3);
            wsManager.Save();
        }
All Usage Examples Of SIL.CoreImpl.PalasoWritingSystemManager::Exists