Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public ResolveKeyTermRenderingImportConflictDlg(IWin32Window owner, IChkRef occurrence,
                                                        string existingRendering, string importedRendering, IVwStylesheet ss) : this()
        {
            FdoCache     cache  = occurrence.Cache;
            IScripture   scr    = cache.LangProject.TranslatedScriptureOA;
            ScrReference scrRef = (new ScrReference(occurrence.Ref, scr.Versification));

            m_owner                = owner;
            m_lblAnalysis.Text     = occurrence.OwnerOfClass <IChkTerm>().Name.AnalysisDefaultWritingSystem.Text;
            m_lblOriginal.Text     = occurrence.KeyWord.Text;
            m_lblScrReference.Text = scrRef.ToString();
            m_btnExisting.Text     = String.Format(m_btnExisting.Text, existingRendering);
            m_btnImported.Text     = String.Format(m_btnImported.Text, importedRendering);

            // We do this outside the designer-controlled code because it does funny things
            // to FwMultiParaTextBox, owing to the need for a writing system factory, and some
            // properties it should not persist but I can't persuade it not to.
//			IStText text = new NonEditableMultiTss(TeEditingHelper.GetVerseText(cache.LangProject.TranslatedScriptureOA, scrRef).ToString(true, " "));
            //m_verseTextLabel = new FwMultiParaTextBox(text, ss);
            m_verseTextLabel = new FwLabel();
            m_verseTextLabel.WritingSystemFactory = cache.WritingSystemFactory; // set ASAP.
            m_verseTextLabel.WritingSystemCode    = cache.DefaultVernWs;
            m_verseTextLabel.StyleSheet           = ss;                         // before setting text, otherwise it gets confused about height needed.
            m_verseTextLabel.Location             = new Point(0, 0);
            m_verseTextLabel.Name      = "m_textBox";
            m_verseTextLabel.Dock      = DockStyle.Fill;
            m_verseTextLabel.TabIndex  = 0;
            m_verseTextLabel.TextAlign = ContentAlignment.TopLeft;
            //m_verseTextLabel.BorderStyle = BorderStyle.None;
            //m_textBox.SuppressEnter = true;
            m_pnlActualVerseText.Controls.Add(m_verseTextLabel);
            // ENHANCE: Figure out how to get each part (paragraph) of the verse onm its own line. Using newlines or hard line breaks doesn't work.
            ITsIncStrBldr bldr = TsIncStrBldrClass.Create();

            foreach (TeEditingHelper.VerseTextSubstring verseTextSubstring in TeEditingHelper.GetVerseText(cache.LangProject.TranslatedScriptureOA, scrRef))
            {
                bldr.AppendTsString(verseTextSubstring.Tss);
                bldr.Append(StringUtils.kChHardLB.ToString());
            }
            m_verseTextLabel.Tss = bldr.GetString();
            //m_verseTextLabel.Tss = TeEditingHelper.GetVerseText(cache.LangProject.TranslatedScriptureOA, scrRef).ToString(true, StringUtils.kChHardLB.ToString());
        }
Exemplo n.º 3
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 (m_editingHelper != null && !m_editingHelper.ProjectSettings.SendSyncMessages)
				return;

			m_fIgnoreNextRecvdSantaFeSyncMessage = true;
			m_fIgnoreNextRecvdLibronixSyncMessage = true;
			VersificationTable.Get(Paratext.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));
		}