Esempio n. 1
0
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			//Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
			// Must not be run more than once.
			if (IsDisposed)
				return;

			base.Dispose(disposing);

			if (disposing)
			{
				if (components != null)
				{
					components.Dispose();
				}
				if (m_PhoneEnvReferenceVc != null)
					m_PhoneEnvReferenceVc.Dispose();
			}
			m_validator = null; // TODO: Make m_validator disposable?
			m_realEnvs.Clear();
			m_realEnvs = null;
			m_rootObj = null;
			if (m_tsf != null)
				System.Runtime.InteropServices.Marshal.ReleaseComObject(m_tsf);
			m_tsf = null;
			m_silCache = null;
			if (m_vwCache != null)
				System.Runtime.InteropServices.Marshal.ReleaseComObject(m_vwCache);
			m_vwCache = null;
			m_PhoneEnvReferenceVc = null;
		}
Esempio n. 2
0
		public void Initialize(MoForm rootObj, int rootFlid, FdoCache cache)
		{
			CheckDisposed();

			Debug.Assert(rootObj is MoAffixAllomorph || rootObj is MoStemAllomorph);
			Debug.Assert(cache != null && m_fdoCache == null);
			m_fdoCache = cache;
			ResetValidator();
			m_wsVern = m_fdoCache.LangProject.DefaultVernacularWritingSystem;
			m_rootObj = rootObj;
			m_rootFlid = rootFlid;
			if (m_rootb == null)
				MakeRoot();
		}