Ejemplo n.º 1
0
        /// <summary>

        ///   Print a single hit item

        /// </summary>

        /// <returns>Document to print</returns>

        /// <history>

        ///   [Theodore_Ward]   ??/??/????  Initial

        ///     [Curtis_Beard]	   01/11/2005	.Net Conversion

        ///   [Curtis_Beard]	   11/01/2005	CHG: Get correct hit object index

        /// </history>

        public string PrintSingleItem()

        {
            if (__listView.SelectedItems.Count > 0)

            {
                HitObject _hit = (HitObject)__grepTable[int.Parse(__listView.SelectedItems[0].SubItems[AstroGrep.Constants.COLUMN_INDEX_GREP_INDEX].Text)];



                SetupDocument(string.Empty);



                AddLine("----------------------------------------------------------------------");

                AddLine(_hit.FilePath);

                AddLine("----------------------------------------------------------------------");



                for (int _index = 0; _index < _hit.LineCount; _index++)
                {
                    PrintHit(_hit.RetrieveLine(_index));
                }
            }



            return(__document);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Checks to see if the given line is already recognized as a hit.
        /// </summary>
        /// <param name="line">line to check</param>
        /// <param name="hit">HitObject containing all previous hits</param>
        /// <returns>True if found, False otherwise</returns>
        /// <history>
        /// [Curtis_Beard]      07/28/2006  Created
        /// </history>
        private bool HitExists(string line, HitObject hit)
        {
            for (int i = 0; i < hit.LineCount; i++)
            {
                if (hit.RetrieveLine(i).IndexOf(line) > -1)
                {
                    return(true);
                }
            }

            return(false);
        }