Example #1
0
        /// <summary>
        /// Creates an text buffer from the given file.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <returns>The text buffer.</returns>
        public static ITextBufferStrategy CreateTextBufferFromFile(string fileName)
        {
            if (!File.Exists(fileName))
            {
                throw new FileNotFoundException(fileName);
            }

            StringTextBufferStrategy s = new StringTextBufferStrategy();

            s.SetContent(Utilities.FileReader.ReadFileContent(fileName, Encoding.Default));
            return(s);
        }
    /// <summary>
    /// Creates an text buffer from the given file.
    /// </summary>
    /// <param name="fileName">Name of the file.</param>
    /// <returns>The text buffer.</returns>
    public static ITextBufferStrategy CreateTextBufferFromFile(string fileName)
    {
      if (!File.Exists(fileName))
        throw new FileNotFoundException(fileName);

      StringTextBufferStrategy s = new StringTextBufferStrategy();
      s.SetContent(Utilities.FileReader.ReadFileContent(fileName, Encoding.Default));
      return s;
    }