Inheritance: SIL.FieldWorks.Common.Framework.DetailControls.AtomicReferenceLauncher
コード例 #1
0
		/// <summary>
		/// Override method to add suitable control.
		/// </summary>
		public override void FinishInit()
		{
			CheckDisposed();
			Debug.Assert(m_cache != null);
			Debug.Assert(m_configurationNode != null);

			base.FinishInit();
			m_fieldName = XmlUtils.GetManditoryAttributeValue(m_configurationNode, "field");
			string className = m_cache.MetaDataCacheAccessor.GetClassName((uint)m_obj.ClassID);

			m_flid = AutoDataTreeMenuHandler.ContextMenuHelper.GetFlid(m_cache.MetaDataCacheAccessor,
				className, m_fieldName);
			AdhocCoProhibAtomicLauncher launcher = new AdhocCoProhibAtomicLauncher();
			launcher.Initialize(m_cache, m_obj, m_flid, m_fieldName,
				null,
				Mediator,
				DisplayNameProperty,
				BestWsName);
			// We don't want to be visible until later, since otherwise we get a temporary
			// display in the wrong place with the wrong size that serves only to annoy the
			// user.  See LT-1518 "The drawing of the DataTree for Lexicon/Advanced Edit draws
			// some initial invalid controls."  Becoming visible when we set the width and
			// height seems to delay things enough to avoid this visual clutter.
			launcher.Visible = false;
			Control = launcher;

			//We need to set the Font so the height of this slice will be
			//set appropriately to fit the text.
			IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(Mediator);
			int fontHeight = FontHeightAdjuster.GetFontHeightForStyle(
					"Normal", stylesheet,
					m_cache.LangProject.DefaultVernacularWritingSystem,
					m_cache.LanguageWritingSystemFactoryAccessor);
			this.Font = new System.Drawing.Font(m_cache.LangProject.DefaultVernacularWritingSystemFont, fontHeight / 1000);
		}
コード例 #2
0
        /// <summary>
        /// Override method to add suitable control.
        /// </summary>
        public override void FinishInit()
        {
            CheckDisposed();
            Debug.Assert(m_cache != null);
            Debug.Assert(m_configurationNode != null);

            base.FinishInit();
            m_fieldName = XmlUtils.GetManditoryAttributeValue(m_configurationNode, "field");
            string className = m_cache.MetaDataCacheAccessor.GetClassName((uint)m_obj.ClassID);

            m_flid = AutoDataTreeMenuHandler.ContextMenuHelper.GetFlid(m_cache.MetaDataCacheAccessor,
                                                                       className, m_fieldName);
            AdhocCoProhibAtomicLauncher launcher = new AdhocCoProhibAtomicLauncher();

            launcher.Initialize(m_cache, m_obj, m_flid, m_fieldName,
                                null,
                                Mediator,
                                DisplayNameProperty,
                                BestWsName);
            // We don't want to be visible until later, since otherwise we get a temporary
            // display in the wrong place with the wrong size that serves only to annoy the
            // user.  See LT-1518 "The drawing of the DataTree for Lexicon/Advanced Edit draws
            // some initial invalid controls."  Becoming visible when we set the width and
            // height seems to delay things enough to avoid this visual clutter.
            launcher.Visible = false;
            Control          = launcher;

            //We need to set the Font so the height of this slice will be
            //set appropriately to fit the text.
            IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(Mediator);
            int           fontHeight = FontHeightAdjuster.GetFontHeightForStyle(
                "Normal", stylesheet,
                m_cache.LangProject.DefaultVernacularWritingSystem,
                m_cache.LanguageWritingSystemFactoryAccessor);

            this.Font = new System.Drawing.Font(m_cache.LangProject.DefaultVernacularWritingSystemFont, fontHeight / 1000);
        }