Exemple #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Sends a sync. message to external application who may be monitoring a Santa Fe
        /// message (e.g. Paratext) or a Libronix message.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void SendExternalSyncMessage(ScrReference scrRef)
        {
            if (!TeProjectSettings.SendSyncMessages)
            {
                return;
            }

            m_fIgnoreNextRecvdSantaFeSyncMessage  = true;
            m_fIgnoreNextRecvdLibronixSyncMessage = true;
            VersificationTable.Get(ScrVers.English).ChangeVersification(scrRef);
            SantaFeFocusMessageHandler.SendFocusMessage(scrRef.ToString());

            // Make a new copy each time in case callee does something that modifies it.
            SyncLibronix(new ScrReference(scrRef));
        }
Exemple #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Receive from Santa Fe windows any changes in Scripture Reference.
        /// </summary>
        /// <param name="msg">The windows message.</param>
        /// ------------------------------------------------------------------------------------
        public void ReceiveFocusMessage(Message msg)
        {
            // Always assume the English versification scheme for passing references.
            var scrRef = new ScrReference(
                SantaFeFocusMessageHandler.ReceiveFocusMessage(msg), ScrVers.English);

            if (!TeProjectSettings.ReceiveSyncMessages || m_fIgnoreNextRecvdSantaFeSyncMessage ||
                m_fProcessingSyncMessage || m_fIgnoreAnySyncMessages)
            {
                if (m_fProcessingSyncMessage)
                {
                    m_queuedReference = scrRef;
                }

                m_fIgnoreNextRecvdSantaFeSyncMessage = false;
                return;
            }

            ProcessReceivedMessage(scrRef);
        }