Example #1
0
        /// <summary>
        /// Looks up the buffer for a given file and saves the its current line ending character for the undo operation.
        /// </summary>
        /// <param name="filePath">The path to the open file whose line endings should change.</param>
        /// <param name="newLineEnding">The EOL style to which the file should change.</param>
        public ChangeLineEndings(string filePath, LineEndings newLineEnding)
        {
            Name = "Change EOLs to " + newLineEnding;

            _buffer = ApplicationState.Instance.FileHandlerInstance.GetFileBuffer(filePath);
            _newLineEndingCharacter       = newLineEnding;
            _previousLineEndingsCharacter = _buffer.FileInstance.EndOfLineCharacter;
        }
Example #2
0
        /// <summary>
        /// Looks up the buffer for a given file and saves its current encoding for the undo operation.
        /// </summary>
        /// <param name="filePath">The path to the open file whose interpretation should change.</param>
        /// <param name="newEncoding">The encoding to which the interpretation should change.</param>
        public ChangeEncodingInterpretation(string filePath, EncodingType newEncoding)
        {
            Name = "Interpret as " + newEncoding;

            _buffer           = ApplicationState.Instance.FileHandlerInstance.GetFileBuffer(filePath);
            _newEncoding      = newEncoding;
            _previousEncoding = _buffer.FileInstance.InputEncoding;
        }
Example #3
0
        /// <summary>
        /// Looks up the buffer for a given file and saves the its current encoding for the undo operation.
        /// </summary>
        /// <param name="filePath">The path to the open file whose encoding should change.</param>
        /// <param name="newEncoding">The encoding to which the file should change.</param>
        public ConvertEncoding(string filePath, EncodingType newEncoding)
        {
            Name = "Convert Encoding to " + newEncoding;

            _buffer           = ApplicationState.Instance.FileHandlerInstance.GetFileBuffer(filePath);
            _newEncoding      = newEncoding;
            _previousEncoding = _buffer.FileInstance.OutputEncoding;
        }