Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Links to lexicon.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        internal void LinkToLexicon()
        {
            CheckDisposed();
            int hvo = m_hvoSelected;

            if (hvo == 0 && m_rghvo != null && m_rghvo.Count > 0)
            {
                hvo = m_rghvo[0];
            }
            // REVIEW: THIS SHOULD NEVER HAPPEN, BUT IF IT DOES, SHOULD WE TELL THE USER ANYTHING?
            if (hvo == 0)
            {
                return;
            }
            FwLink link = FwLink.Create("Language Explorer", "lexiconEdit", m_cache.GetGuidFromId(hvo),
                                        m_cache.ServerName, m_cache.DatabaseName);

            if (Application.ProductName == link.ApplicationName)
            {
                Debug.Assert(m_mediator != null,
                             "If we're linking to same app, then the program must pass in a mediator!");
                m_mediator.SendMessage("FollowLink", link);
            }
            else
            {
                link.Activate();
            }
        }
Beispiel #2
0
        private void btnStyles_Click(object sender, System.EventArgs e)
        {
            XCore.Mediator  med = null;
            LexImportWizard wiz = LexImportWizard.Wizard();

            if (wiz != null)
            {
                med = wiz.Mediator;
            }
            if (med == null)
            {
                // See LT-9100 and LT-9266.  Apparently this condition can happen.
                MessageBox.Show(LexTextControls.ksCannotSoTryAgain, LexTextControls.ksInternalProblem,
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            med.SendMessage("FormatStyle", null);
            // The "styles" dialog can trigger a refresh, which disposes of the mediator on the
            // main window, creating a new one.  See LT-7275.
            // The accessor gets a new one if the old one has been disposed.
            if (med.IsDisposed)
            {
                med = wiz.Mediator;
            }
            // We also need to re-initialize the combobox list, since the set of character
            // styles may have changed.
            InitializeStylesComboBox();
        }