-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated libraries and targeting builds for the test projects.
- Loading branch information
Showing
10 changed files
with
476 additions
and
512 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 |
---|---|---|
@@ -1,28 +1,30 @@ | ||
using System; | ||
|
||
namespace ConsoleApplication | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
Console.WriteLine("ReadLine Library Demo"); | ||
Console.WriteLine("---------------------"); | ||
Console.WriteLine(); | ||
namespace ReadLine.Demo { | ||
public class Program { | ||
public static void Main(string[] args) { | ||
Console.WriteLine("ReadLine Library Demo"); | ||
Console.WriteLine("---------------------"); | ||
Console.WriteLine(); | ||
|
||
string[] history = new string[] { "ls -a", "dotnet run", "git init" }; | ||
ReadLine.AddHistory(history); | ||
string[] history = { | ||
"ls -a", | ||
"dotnet run", | ||
"git init" | ||
}; | ||
ReadLine.AddHistory(history); | ||
|
||
ReadLine.AutoCompletionHandler = (t, s) => | ||
{ | ||
if (t.StartsWith("git ")) | ||
return new string[] { "init", "clone", "pull", "push" }; | ||
else | ||
return null; | ||
}; | ||
|
||
string input = ReadLine.Read("(prompt)> "); | ||
Console.Write(input); | ||
ReadLine.AutoCompletionHandler = (t, s) => t.StartsWith("git ") | ||
? new[] { | ||
"init", | ||
"clone", | ||
"pull", | ||
"push" | ||
} | ||
: null; | ||
|
||
var input = ReadLine.Read("(prompt)> "); | ||
Console.Write(input); | ||
} | ||
} | ||
} | ||
} |
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
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,50 +1,43 @@ | ||
using Internal.ReadLine.Abstractions; | ||
|
||
namespace ReadLine.Tests.Abstractions | ||
{ | ||
internal class Console2 : IConsole | ||
{ | ||
public int CursorLeft => _cursorLeft; | ||
|
||
public int CursorTop => _cursorTop; | ||
|
||
public int BufferWidth => _bufferWidth; | ||
|
||
public int BufferHeight => _bufferHeight; | ||
|
||
private int _cursorLeft; | ||
private int _cursorTop; | ||
private int _bufferWidth; | ||
private int _bufferHeight; | ||
|
||
public Console2() | ||
{ | ||
_cursorLeft = 0; | ||
_cursorTop = 0; | ||
_bufferWidth = 100; | ||
_bufferHeight = 100; | ||
} | ||
|
||
public void SetBufferSize(int width, int height) | ||
{ | ||
_bufferWidth = width; | ||
_bufferHeight = height; | ||
} | ||
|
||
public void SetCursorPosition(int left, int top) | ||
{ | ||
_cursorLeft = left; | ||
_cursorTop = top; | ||
} | ||
|
||
public void Write(string value) | ||
{ | ||
_cursorLeft += value.Length; | ||
} | ||
|
||
public void WriteLine(string value) | ||
{ | ||
_cursorLeft += value.Length; | ||
} | ||
using ReadLine.Abstractions; | ||
|
||
namespace ReadLine.Tests.Abstractions { | ||
internal class Console2 : IConsole { | ||
public int CursorLeft => _cursorLeft; | ||
|
||
public int CursorTop => _cursorTop; | ||
|
||
public int BufferWidth => _bufferWidth; | ||
|
||
public int BufferHeight => _bufferHeight; | ||
|
||
private int _cursorLeft; | ||
private int _cursorTop; | ||
private int _bufferWidth; | ||
private int _bufferHeight; | ||
|
||
public Console2() { | ||
_cursorLeft = 0; | ||
_cursorTop = 0; | ||
_bufferWidth = 100; | ||
_bufferHeight = 100; | ||
} | ||
|
||
public void SetBufferSize(int width, int height) { | ||
_bufferWidth = width; | ||
_bufferHeight = height; | ||
} | ||
|
||
public void SetCursorPosition(int left, int top) { | ||
_cursorLeft = left; | ||
_cursorTop = top; | ||
} | ||
|
||
public void Write(string value) { | ||
_cursorLeft += value.Length; | ||
} | ||
|
||
public void WriteLine(string value) { | ||
_cursorLeft += value.Length; | ||
} | ||
} | ||
} |
Oops, something went wrong.