SIL.FieldWorks.Common.Framework.DetailControls.AtomicReferencePOSSlice.AtomicReferencePOSSlice C# (CSharp) Méthode

AtomicReferencePOSSlice() public méthode

Constructor.
public AtomicReferencePOSSlice ( SIL.FieldWorks.FDO.FdoCache cache, ICmObject obj, int flid, IPersistenceProvider persistenceProvider, XCore.Mediator mediator ) : System.Drawing
cache SIL.FieldWorks.FDO.FdoCache
obj ICmObject CmObject that is being displayed.
flid int The field identifier for the attribute we are displaying.
persistenceProvider IPersistenceProvider
mediator XCore.Mediator
Résultat System.Drawing
		public AtomicReferencePOSSlice(FdoCache cache, ICmObject obj, int flid,
			IPersistenceProvider persistenceProvider, Mediator mediator)
			: base(new UserControl(), cache, obj, flid)
		{
			IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(mediator);
			IWritingSystem defAnalWs = m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem;
			m_tree = new TreeCombo();
			m_tree.WritingSystemFactory = cache.WritingSystemFactory;
			m_tree.WritingSystemCode = defAnalWs.Handle;
			m_tree.Font = new System.Drawing.Font(defAnalWs.DefaultFontName, 10);
			m_tree.StyleSheet = stylesheet;
			if (!Application.RenderWithVisualStyles)
				m_tree.HasBorder = false;
			// We embed the tree combo in a layer of UserControl, so it can have a fixed width
			// while the parent window control is, as usual, docked 'fill' to work with the splitter.
			m_tree.Dock = DockStyle.Left;
			m_tree.Width = 200;
			Control.Controls.Add(m_tree);
			if (m_pOSPopupTreeManager == null)
			{
				ICmPossibilityList list;
				int ws;
				if (obj is IReversalIndexEntry)
				{
					var rie = obj as IReversalIndexEntry;
					list = rie.ReversalIndex.PartsOfSpeechOA;
					ws = m_cache.ServiceLocator.WritingSystemManager.GetWsFromStr(rie.ReversalIndex.WritingSystem);
				}
				else
				{
					list = m_cache.LanguageProject.PartsOfSpeechOA;
					ws = m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Handle;
				}
				m_tree.WritingSystemCode = ws;
				m_pOSPopupTreeManager = new POSPopupTreeManager(m_tree, m_cache, list, ws, false, mediator, (Form)mediator.PropertyTable.GetValue("window"));
				m_pOSPopupTreeManager.AfterSelect += m_pOSPopupTreeManager_AfterSelect;
			}
			try
			{
				m_handlingMessage = true;
				m_pOSPopupTreeManager.LoadPopupTree(POS == null ? 0 : POS.Hvo);
			}
			finally
			{
				m_handlingMessage = false;
			}
			Control.Height = m_tree.PreferredHeight;
					 // m_tree has sensible PreferredHeight once the text is set, UserControl does not.
					 // we need to set the Height after m_tree.Text has a value set to it.
		}