protected virtual void Dispose(bool disposing)
		{
			System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			if (!IsDisposed)
			{
				if (disposing)
				{
					if (m_mediator != null)
						m_mediator.RemoveColleague(m_window);


					if (m_window != null && !m_window.IsDisposed)
						m_window.Dispose();
					m_window = null;

					if (m_mediator != null && !m_mediator.IsDisposed)
						m_mediator.Dispose();
					m_mediator = null;

					if (m_allReversalEntriesRecordList != null && !m_allReversalEntriesRecordList.IsDisposed)
						m_allReversalEntriesRecordList.Dispose();
					m_allReversalEntriesRecordList = null;
				}
				IsDisposed = true;
			}
		}
Esempio n. 2
0
		public override void Init(LcmCache cache, Mediator mediator, PropertyTable propertyTable, XmlNode recordListNode)
		{
			CheckDisposed();

			// <recordList owner="IReversalIndex" property="AllEntries" assemblyPath="RBRExtensions.dll" class="RBRExtensions.AllReversalEntriesRecordList"/>
			BaseInit(cache, mediator, propertyTable, recordListNode);
			m_flid = CmPossibilityListTags.kflidPossibilities;
			Guid riGuid = AllReversalEntriesRecordList.GetReversalIndexGuid(mediator, propertyTable);
			if (riGuid != Guid.Empty)
			{
				IReversalIndex ri = cache.ServiceLocator.GetObject(riGuid) as IReversalIndex;
				m_owningObject = ri.PartsOfSpeechOA;
				m_fontName = cache.ServiceLocator.WritingSystemManager.Get(ri.WritingSystem).DefaultFontName;
			}
			m_oldLength = 0;
		}
Esempio n. 3
0
        public override void Init(FdoCache cache, Mediator mediator, XmlNode recordListNode)
        {
            CheckDisposed();

            // <recordList owner="ReversalIndex" property="AllEntries" assemblyPath="RBRExtensions.dll" class="RBRExtensions.AllReversalEntriesRecordList"/>
            BaseInit(cache, mediator, recordListNode);
            m_flid = (int)CmPossibilityList.CmPossibilityListTags.kflidPossibilities;
            int rih = AllReversalEntriesRecordList.GetReversalIndexHvo(mediator);

            if (rih > 0)
            {
                IReversalIndex ri = ReversalIndex.CreateFromDBObject(cache, rih);
                m_owningObject = ri.PartsOfSpeechOA;
                m_fontName     = ri.WritingSystemRA.DefaultSerif;
            }
            m_oldLength = 0;
        }
		public void AllReversalIndexes_Init_Test()
		{
			const string reversalIndexClerk = @"
<recordList owner='ReversalIndex' property='AllEntries'>
	<dynamicloaderinfo assemblyPath='LexEdDll.dll' class='SIL.FieldWorks.XWorks.LexEd.AllReversalEntriesRecordList' />
</recordList>";
			XmlDocument doc = new XmlDocument();
			doc.LoadXml(reversalIndexClerk);
			XmlNode newNode = doc.DocumentElement;
			using (var list = new AllReversalEntriesRecordList())
			{
				list.Init(Cache, m_mediator, newNode);

				Assert.IsNull(list.OwningObject,
					"When AllReversalEntriesRecordList is called and the Clerk is null then the OwningObject should not be set, i.e. left as Null");
			}
		}