Beispiel #1
0
 /// <summary>
 /// Requires a language object
 /// </summary>
 /// <param name="lang"></param>
 public WebPageInteractor(HtmlControl htmlControl, ParserTrace parserTrace, Mediator mediator, SIL.FieldWorks.Common.Widgets.FwTextBox tbWordForm)
 {
     m_htmlControl = htmlControl;
     m_parserTrace = parserTrace;
     m_mediator    = mediator;
     m_cache       = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
     m_tbWordForm  = tbWordForm;
 }
        public WebPageInteractor(HtmlControl htmlControl, ParserTrace parserTrace, Mediator mediator, FwTextBox tbWordForm)
        {
            m_htmlControl = htmlControl;
            ParserTrace   = parserTrace;
            m_mediator    = mediator;
            m_cache       = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
            m_tbWordForm  = tbWordForm;
#if __MonoCS__
            m_htmlControl.Browser.DomClick     += HandleDomClick;
            m_htmlControl.Browser.DomMouseMove += HandleHtmlControlBrowserDomMouseMove;
#endif
        }
Beispiel #3
0
        private void SetParserTrace()
        {
            if (DoTrace)
            {
                switch (Connection.Parser.Parser)
                {
                case "XAmple":
                    m_parserTrace = m_xampleTrace;
                    break;

                case "HC":
                    m_parserTrace = m_hermitCrabTrace;
                    break;
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// The real deal
        /// </summary>
        /// <param name="mediator"></param>
        public ParseWordDlg(Mediator mediator)
        {
            m_mediator                  = mediator;
            m_xampleTrace               = new XAmpleTrace(mediator);
            m_hermitCrabTrace           = new HCTrace(mediator);
            m_parserTrace               = m_xampleTrace; // we'll start with the default one; it can get changed by the user
            m_cache                     = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
            m_sLastWordUsedPropertyName = m_cache.DatabaseName + "ParseWordDlg-lastWordToTry";
            m_sWhileTracingFile         = Path.Combine(TransformPath, "WhileTracing.htm");
            m_sXAmpleSelectFile         = Path.Combine(Path.GetTempPath(), m_cache.DatabaseName + "XAmpleSelectFile.txt");

            m_connectionTimer          = new System.Windows.Forms.Timer();
            m_connectionTimer.Interval = 250;             // use a quarter of a second
            m_connectionTimer.Tick    += new EventHandler(m_connectionTimer_Tick);

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Text = m_cache.DatabaseName + " - " + this.Text;
            // order is important between SetInitialWord and SetRootSite
            SetRootSite();
            SetInitialWord();

            InitHtmlControl();

            SetStrings();

            // HermitCrab does not currently support selected tracing
            if (m_cache.LangProject.MorphologicalDataOA.ActiveParser == "HC")
            {
                m_fParserCanDoSelectMorphs = false;
                m_cbDoSelectMorphs.Enabled = false;
            }

            if (FwApp.App != null)            // Could be null during testing
            {
                this.helpProvider = new System.Windows.Forms.HelpProvider();
                this.helpProvider.HelpNamespace = FwApp.App.HelpFile;
                this.helpProvider.SetHelpKeyword(this, FwApp.App.GetHelpString(s_helpTopic, 0));
                this.helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);
            }
        }
Beispiel #5
0
		/// <summary>
		/// Requires a language object
		/// </summary>
		/// <param name="lang"></param>
		public WebPageInteractor(HtmlControl htmlControl, ParserTrace parserTrace, Mediator mediator, SIL.FieldWorks.Common.Widgets.FwTextBox tbWordForm)
		{
			m_htmlControl = htmlControl;
			m_parserTrace = parserTrace;
			m_mediator = mediator;
			m_cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
			m_tbWordForm = tbWordForm;
		}
Beispiel #6
0
		private void SetParserTrace()
		{
			if (DoTrace)
			{
				switch (Connection.Parser.Parser)
				{
					case "XAmple":
						m_parserTrace = m_xampleTrace;
						break;

					case "HC":
						m_parserTrace = m_hermitCrabTrace;
						break;
				}
			}
		}
Beispiel #7
0
		/// <summary>
		/// The real deal
		/// </summary>
		/// <param name="mediator"></param>
		public ParseWordDlg(Mediator mediator)
		{
			m_mediator = mediator;
			m_xampleTrace = new XAmpleTrace(mediator);
			m_hermitCrabTrace = new HCTrace(mediator);
			m_parserTrace = m_xampleTrace; // we'll start with the default one; it can get changed by the user
			m_cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
			m_sLastWordUsedPropertyName = m_cache.DatabaseName + "ParseWordDlg-lastWordToTry";
			m_sWhileTracingFile = Path.Combine(TransformPath, "WhileTracing.htm");
			m_sXAmpleSelectFile = Path.Combine(Path.GetTempPath(), m_cache.DatabaseName + "XAmpleSelectFile.txt");

			m_connectionTimer = new System.Windows.Forms.Timer();
			m_connectionTimer.Interval = 250; // use a quarter of a second
			m_connectionTimer.Tick += new EventHandler(m_connectionTimer_Tick);

			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			this.Text = m_cache.DatabaseName + " - " + this.Text;
			// order is important between SetInitialWord and SetRootSite
			SetRootSite();
			SetInitialWord();

			InitHtmlControl();

			SetStrings();

			// HermitCrab does not currently support selected tracing
			if (m_cache.LangProject.MorphologicalDataOA.ActiveParser == "HC")
			{
				m_fParserCanDoSelectMorphs = false;
				m_cbDoSelectMorphs.Enabled = false;
			}

			if(FwApp.App != null) // Could be null during testing
			{
				this.helpProvider = new System.Windows.Forms.HelpProvider();
				this.helpProvider.HelpNamespace = FwApp.App.HelpFile;
				this.helpProvider.SetHelpKeyword(this, FwApp.App.GetHelpString(s_helpTopic, 0));
				this.helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);
			}
		}