-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dirty flag (right and left) Asterix display for unsaved changes…
… (edit text without saving)
- Loading branch information
1 parent
ea627fd
commit b106e42
Showing
10 changed files
with
138 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
namespace AehnlichLib.Files | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
/// <summary> | ||
/// Implements a text content container class for the text, lines an other | ||
/// related content specific to computing diffs from texts. | ||
/// </summary> | ||
public class FileContentInfo | ||
{ | ||
#region constructors | ||
/// <summary>Class constructor</summary> | ||
/// <param name="isBinary"></param> | ||
/// <param name="lines"></param> | ||
/// <param name="filePath"></param> | ||
public FileContentInfo(bool isBinary, IList<string> lines, string filePath) | ||
: this(isBinary, lines) | ||
{ | ||
FilePath = filePath; | ||
} | ||
|
||
/// <summary>Class constructor</summary> | ||
/// <param name="isBinary"></param> | ||
/// <param name="lines"></param> | ||
public FileContentInfo(bool isBinary, IList<string> lines) | ||
: this() | ||
{ | ||
TextContent = null; | ||
Lines = lines; | ||
} | ||
/// <summary>Class constructor</summary> | ||
/// <param name="filePath"></param> | ||
public FileContentInfo(string filePath) | ||
: this() | ||
{ | ||
// Just use a different constructor if a valid path was not required. | ||
if (string.IsNullOrEmpty(filePath)) | ||
throw new NotSupportedException("This constructor should not be used without valid path."); | ||
|
||
FilePath = filePath; | ||
} | ||
|
||
/// <summary>Class constructor</summary> | ||
public FileContentInfo() | ||
{ | ||
IsBinary = false; | ||
TextEncoding = Encoding.Default; | ||
TextContent = string.Empty; | ||
Lines = new List<string>(); | ||
} | ||
#endregion constructors | ||
|
||
#region properties | ||
/// <summary>Gets the detected encoding of the text file content</summary> | ||
public Encoding TextEncoding { get; set; } | ||
|
||
/// <summary>Gets the text file content</summary> | ||
public string TextContent { get; set; } | ||
|
||
public IList<string> Lines { get; set; } | ||
|
||
/// <summary>Gets the full path to file A</summary> | ||
public string FilePath { get; } | ||
|
||
/// <summary>Get whether the content should be treated as binary or not.</summary> | ||
public bool IsBinary { get; } | ||
|
||
/// <summary>Gets/sets whether the currently shown text in the textedior has been changed | ||
/// without saving or not.</summary> | ||
public bool IsDirty { get; set; } | ||
#endregion properties | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<Application | ||
x:Class="AehnlichDirDemo.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:AehnlichDirDemo" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources /> | ||
x:Class="AehnlichDirDemo.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:AehnlichDirDemo" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources /> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.