/// <summary>
        /// Takes the specified number of lines from the file
        /// </summary>
        /// <param name="linesToTake">The lines to take.</param>
        /// <returns></returns>
        public fileTextLineCollection Take(Int32 linesToTake, List <String> shadow, List <String> shadowBuffer = null)
        {
            fileTextLineCollection output = new fileTextLineCollection();

            using (var st = File.OpenText(file.FullName))
            {
                Int32 ln = 0;
                while (!st.EndOfStream)
                {
                    String line = st.ReadLine();
                    if (shadow != null)
                    {
                        if (!shadow.Contains(line))
                        {
                            if (shadowBuffer != null)
                            {
                                if (!String.IsNullOrWhiteSpace(line))
                                {
                                    if (!shadowBuffer.Contains(line))
                                    {
                                        output.Add(ln, line);
                                    }
                                }
                            }
                            else
                            {
                                if (!String.IsNullOrWhiteSpace(line))
                                {
                                    output.Add(ln, line);
                                }
                            }
                        }
                    }
                    else
                    {
                        output.Add(ln, line);
                    }

                    if (linesToTake > 0)
                    {
                        if (output.Count() >= linesToTake)
                        {
                            break;
                        }
                    }

                    ln++;
                }
                st.Close();
                st.Dispose();
            }

            return(output);
        }
        /// <summary>
        /// Searches the specified cached lines.
        /// </summary>
        /// <param name="cachedLines">The cached lines.</param>
        /// <param name="__needle">The needle.</param>
        /// <param name="useRegex">if set to <c>true</c> [use regex].</param>
        /// <param name="limitResult">The limit result.</param>
        /// <param name="regexOptions">The regex options.</param>
        /// <returns></returns>
        public fileTextSearchResult Search(fileTextLineCollection cachedLines, String __needle, Boolean useRegex = false, Int32 limitResult = -1, RegexOptions regexOptions = RegexOptions.None)
        {
            fileTextSearchResult   output = new fileTextSearchResult(__needle, file.FullName, useRegex);
            fileTextOperaterWorker eval   = new fileTextOperaterWorker(__needle, useRegex, regexOptions);

            foreach (var lp in cachedLines)
            {
                String match = "";
                if (eval.evaluate(lp.Value, out match))
                {
                    output.Add(lp.Key, lp.Value, false);
                }

                if (output.CountThreadSafe > limitResult)
                {
                    output.resultLimitTriggered = true;
                    break;
                }
            }
            return(output);
        }