Beispiel #1
0
        private void TryTheWord()
        {
            string sWord = CleanUpWord();
            // check to see if limiting trace and, if so, if all morphs have msas
            string sSelectTraceMorphs;

            if (!GetSelectTraceMorphs(out sSelectTraceMorphs))
            {
                return;
            }
            // Display a "processing" message (and include info on how to improve the results)
            m_htmlControl.URL = m_sWhileTracingFile;
            sWord             = sWord.Replace(' ', '.'); // LT-7334 to allow for phrases; do this at the last minute
            Connection.TryAWordDialogIsRunning = true;   // make sure this is set properly
            Connection.ParseAllWordforms       = false;

            SetParserTrace();
            WebPageInteractor webPageInteractor = (WebPageInteractor)m_htmlControl.Browser.ObjectForScripting;

            if (webPageInteractor != null)
            {
                webPageInteractor.ParserTrace = m_parserTrace;
            }

            Connection.TryAWordAsynchronously(sWord, DoTrace, sSelectTraceMorphs);
            // waiting for result, so disable Try It button
            m_btnTryIt.Enabled = false;
        }
Beispiel #2
0
        public void SetDlgInfo(Mediator mediator, IWfiWordform wordform, ParserListener parserListener)
        {
            m_mediator        = mediator;
            m_persistProvider = new PersistenceProvider(PersistProviderID, m_mediator.PropertyTable);
            m_persistProvider.RestoreWindowSettings(PersistProviderID, this);
            m_xampleTrace     = new XAmpleTrace(mediator);
            m_hermitCrabTrace = new HCTrace(mediator);
            m_cache           = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
            m_parserListener  = parserListener;

            Text = m_cache.ProjectId.UiName + " - " + Text;
            SetRootSite();
            SetFontInfo();
            if (wordform == null)
            {
                GetLastWordUsed();
            }
            else
            {
                SetWordToUse(wordform.Form.VernacularDefaultWritingSystem.Text);
            }

            m_webPageInteractor = new WebPageInteractor(m_htmlControl, ParserTrace, m_mediator, m_wordformTextBox);
#if !__MonoCS__
            m_htmlControl.Browser.ObjectForScripting = m_webPageInteractor;
#endif

            // HermitCrab does not currently support selected tracing

            /*if (m_cache.LangProject.MorphologicalDataOA.ActiveParser == "HC")
             * {
             *      m_parserCanDoSelectMorphs = false;
             *      m_doSelectMorphsCheckBox.Enabled = false;
             * }
             */
            // No such thing as FwApp.App now: if(FwApp.App != null) // Could be null during testing
            if (m_mediator.HelpTopicProvider != null)             // trying this
            {
                m_helpProvider.HelpNamespace = m_mediator.HelpTopicProvider.HelpFile;
                m_helpProvider.SetHelpKeyword(this, m_mediator.HelpTopicProvider.GetHelpString(HelpTopicID));
                m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            }

            if (m_parserListener.Connection != null)
            {
                m_parserListener.Connection.TryAWordDialogIsRunning = true;
                m_statusLabel.Text = GetString("ParserStatusPrefix") + ParserUIStrings.ksIdle_ + GetString("ParserStatusSuffix");
            }
            else
            {
                m_statusLabel.Text = ParserStoppedMessage();
            }
        }
Beispiel #3
0
        public void SetDlgInfo(Mediator mediator, PropertyTable propertyTable, IWfiWordform wordform, ParserListener parserListener)
        {
            Mediator          = mediator;
            PropTable         = propertyTable;
            m_persistProvider = new PersistenceProvider(Mediator, propertyTable, PersistProviderID);
            m_cache           = PropTable.GetValue <LcmCache>("cache");
            m_parserListener  = parserListener;

            Text = m_cache.ProjectId.UiName + " - " + Text;
            SetRootSite();
            SetFontInfo();
            // restore window location and size after setting up the form textbox, because it might adjust size of
            // window causing the window to grow every time it is opened
            m_persistProvider.RestoreWindowSettings(PersistProviderID, this);
            if (wordform == null)
            {
                GetLastWordUsed();
            }
            else
            {
                SetWordToUse(wordform.Form.VernacularDefaultWritingSystem.Text);
            }

            m_webPageInteractor = new WebPageInteractor(m_htmlControl, Mediator, m_cache, m_wordformTextBox);

            // No such thing as FwApp.App now: if(FwApp.App != null) // Could be null during testing
            var helpTopicProvider = PropTable.GetValue <IHelpTopicProvider>("HelpTopicProvider");

            if (helpTopicProvider != null)             // trying this
            {
                m_helpProvider.HelpNamespace = helpTopicProvider.HelpFile;
                m_helpProvider.SetHelpKeyword(this, helpTopicProvider.GetHelpString(HelpTopicID));
                m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            }

            if (m_parserListener.Connection != null)
            {
                m_parserListener.Connection.TryAWordDialogIsRunning = true;
                m_statusLabel.Text = GetString("ParserStatusPrefix") + ParserUIStrings.ksIdle_ + GetString("ParserStatusSuffix");
            }
            else
            {
                m_statusLabel.Text = ParserStoppedMessage();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            // Must not be run more than once.
            if (IsDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
                if (m_helpProvider != null)
                {
                    m_helpProvider.Dispose();
                }
                m_webPageInteractor = null;
            }
            base.Dispose(disposing);
        }
Beispiel #5
0
		public void SetDlgInfo(Mediator mediator, IWfiWordform wordform, ParserListener parserListener)
		{
			m_mediator = mediator;
			m_persistProvider = new PersistenceProvider(PersistProviderID, m_mediator.PropertyTable);
			m_cache = (FdoCache) m_mediator.PropertyTable.GetValue("cache");
			m_parserListener = parserListener;

			Text = m_cache.ProjectId.UiName + " - " + Text;
			SetRootSite();
			SetFontInfo();
			// restore window location and size after setting up the form textbox, because it might adjust size of
			// window causing the window to grow every time it is opened
			m_persistProvider.RestoreWindowSettings(PersistProviderID, this);
			if (wordform == null)
				GetLastWordUsed();
			else
				SetWordToUse(wordform.Form.VernacularDefaultWritingSystem.Text);

			m_webPageInteractor = new WebPageInteractor(m_htmlControl, m_mediator, m_wordformTextBox);
#if !__MonoCS__
			m_htmlControl.Browser.ObjectForScripting = m_webPageInteractor;
#endif

			// HermitCrab does not currently support selected tracing
			/*if (m_cache.LangProject.MorphologicalDataOA.ActiveParser == "HC")
			{
				m_parserCanDoSelectMorphs = false;
				m_doSelectMorphsCheckBox.Enabled = false;
			}
*/
			// No such thing as FwApp.App now: if(FwApp.App != null) // Could be null during testing
			if (m_mediator.HelpTopicProvider != null) // trying this
			{
				m_helpProvider.HelpNamespace = m_mediator.HelpTopicProvider.HelpFile;
				m_helpProvider.SetHelpKeyword(this, m_mediator.HelpTopicProvider.GetHelpString(HelpTopicID));
				m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
			}

			if (m_parserListener.Connection != null)
			{
				m_parserListener.Connection.TryAWordDialogIsRunning = true;
				m_statusLabel.Text = GetString("ParserStatusPrefix") + ParserUIStrings.ksIdle_ + GetString("ParserStatusSuffix");
			}
			else
			{
				m_statusLabel.Text = ParserStoppedMessage();
			}
		}
Beispiel #6
0
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			// Must not be run more than once.
			if (IsDisposed)
				return;

			if (disposing)
			{
				if (components != null)
					components.Dispose();
				if (m_helpProvider != null)
					m_helpProvider.Dispose();
				m_webPageInteractor = null;
			}
			base.Dispose(disposing);
		}