Example #1
0
        public void TestInitialization()
        {
            var location = new TextLocation(1, 6);

            Assert.That(location.Line, Is.EqualTo(1));
            Assert.That(location.Column, Is.EqualTo(6));
            Assert.That(location.ToString(), Is.EqualTo("1,6"));
        }
Example #2
0
        public override string ToString()
        {
            if (this.IsDeleted)
            {
                return("[TextAnchor (deleted)]");
            }
            TextLocation location = this.Location;

            return(string.Concat("[TextAnchor ", location.ToString(), "]"));
        }
Example #3
0
        /// <summary>
        /// Generate a string describing this annotation
        /// </summary>
        /// <returns>String representation for debugging</returns>
        public override string ToString()
        {
            string Result = String.Format("({0})", Location.ToString());

            if (Type != PreprocessorMarkupType.Text)
            {
                Result += ": #";
                if (Type != PreprocessorMarkupType.OtherDirective)
                {
                    Result += Type.ToString().ToLower() + " ";
                }
                if (Tokens != null)
                {
                    Result += Token.Format(Tokens);
                }
            }
            return(Result);
        }
Example #4
0
    private void FindByText(string text, LanguageType language_type, string translation, TextLocation text_location, bool case_sensitive, TextWordness wordness, int multiplicity, bool at_word_start, bool with_diacritics)
    {
        if (m_client != null)
        {
            PrepareNewSearch();

            if (!String.IsNullOrEmpty(text))
            {
                m_client.FindPhrases(text, language_type, translation, text_location, case_sensitive, wordness, multiplicity, at_word_start, m_with_diacritics);
                if (m_client.FoundPhrases != null)
                {
                    int phrase_count = m_client.FoundPhrases.Count;
                    if (m_client.FoundVerses != null)
                    {
                        int verse_count = m_client.FoundVerses.Count;
                        if (multiplicity == 0)
                        {
                            m_find_result_header = verse_count + ((verse_count == 1) ? " verse" : " verses") + " without " + text + " " + text_location.ToString() + " in " + m_client.FindScope.ToString();
                        }
                        else
                        {
                            m_find_result_header = phrase_count + " matches in " + verse_count + ((verse_count == 1) ? " verse" : " verses") + " with " + text + " " + text_location.ToString() + " in " + m_client.FindScope.ToString();
                        }
                        DisplayFoundVerses(true);
                    }
                }
            }
        }
    }