C# 클래스 System.ConsolePal

파일 보기 프로젝트 열기: dotnet/corefx 1 사용 예제들

Private Properties

프로퍼티 타입 설명
ColorAttributeToConsoleColor ConsoleColor
ConsoleColorToColorAttribute Interop.Kernel32.Color
ConsoleHandleIsWritable bool
EnsureInitialized void
EnsureInitializedCore void
GetBufferInfo Interop.Kernel32.CONSOLE_SCREEN_BUFFER_INFO
GetBufferInfo Interop.Kernel32.CONSOLE_SCREEN_BUFFER_INFO
GetConsoleEncoding System.Text.Encoding
GetCursorPosition void
GetOrCreateReader TextReader
GetStandardFile Stream
GetUseFileAPIs bool
IsAltKeyDown bool
IsDigit bool
IsHandleRedirected bool
IsHandleRedirected bool
IsKeyDownEvent bool
IsModKey bool
Read int
RefreshColors void
SetBufferSize void
Write void
Write void
WriteResetColorString void
WriteSetColorString void
WriteStdoutAnsiString void

공개 메소드들

메소드 설명
Beep ( ) : void
Beep ( int frequency, int duration ) : void
Clear ( ) : void
IsErrorRedirectedCore ( ) : bool

Gets whether Console.In is targeting a terminal display.

IsInputRedirectedCore ( ) : bool

Gets whether Console.In is targeting a terminal display.

IsOutputRedirectedCore ( ) : bool

Gets whether Console.Out is targeting a terminal display.

MoveBufferArea ( int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop ) : void
MoveBufferArea ( int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor ) : void
OpenStandardError ( ) : Stream
OpenStandardInput ( ) : Stream
OpenStandardOutput ( ) : Stream
ReadKey ( bool intercept ) : ConsoleKeyInfo
ResetColor ( ) : void
SetConsoleInputEncoding ( Encoding enc ) : void
SetConsoleOutputEncoding ( Encoding enc ) : void
SetCursorPosition ( int left, int top ) : void
SetWindowPosition ( int left, int top ) : void
SetWindowSize ( int width, int height ) : void
TryGetSpecialConsoleKey ( char givenChars, int startIndex, int endIndex, ConsoleKeyInfo &key, int &keyLength ) : bool

비공개 메소드들

메소드 설명
ColorAttributeToConsoleColor ( Interop c ) : ConsoleColor
ConsoleColorToColorAttribute ( ConsoleColor color, bool isBackground ) : Interop.Kernel32.Color
ConsoleHandleIsWritable ( IntPtr outErrHandle ) : bool
EnsureInitialized ( ) : void

Ensures that the console has been initialized for use.

EnsureInitializedCore ( ) : void

Ensures that the console has been initialized for use.

GetBufferInfo ( ) : Interop.Kernel32.CONSOLE_SCREEN_BUFFER_INFO
GetBufferInfo ( bool throwOnNoConsole, bool &succeeded ) : Interop.Kernel32.CONSOLE_SCREEN_BUFFER_INFO
GetConsoleEncoding ( ) : Encoding

Creates an encoding from the current environment.

GetCursorPosition ( int &left, int &top ) : void

Gets the current cursor position. This involves both writing to stdout and reading stdin.

GetOrCreateReader ( ) : TextReader
GetStandardFile ( int handleType, FileAccess access ) : Stream
GetUseFileAPIs ( int handleType ) : bool
IsAltKeyDown ( Interop ir ) : bool
IsDigit ( char c ) : bool

Gets whether the specified character is a digit 0-9.

IsHandleRedirected ( IntPtr handle ) : bool
IsHandleRedirected ( SafeFileHandle fd ) : bool

Gets whether the specified file descriptor was redirected. It's considered redirected if it doesn't refer to a terminal.

IsKeyDownEvent ( Interop ir ) : bool
IsModKey ( Interop ir ) : bool
Read ( SafeFileHandle fd, byte buffer, int offset, int count ) : int

Reads data from the file descriptor into the buffer.

RefreshColors ( ConsoleColor &toChange, ConsoleColor value ) : void

Refreshes the foreground and background colors in use by the terminal by resetting the colors and then reissuing commands for both foreground and background, if necessary. Before doing so, the toChange ref is changed to value if value is valid.

SetBufferSize ( int width, int height ) : void
Write ( SafeFileHandle fd, byte bufPtr, int count ) : void
Write ( SafeFileHandle fd, byte buffer, int offset, int count ) : void

Writes data from the buffer into the file descriptor.

WriteResetColorString ( ) : void

Writes out the ANSI string to reset colors.

WriteSetColorString ( bool foreground, ConsoleColor color ) : void

Outputs the format string evaluated and parameterized with the color.

WriteStdoutAnsiString ( string value ) : void

Writes a terminfo-based ANSI escape string to stdout.

메소드 상세

Beep() 공개 정적인 메소드

public static Beep ( ) : void
리턴 void

Beep() 공개 정적인 메소드

public static Beep ( int frequency, int duration ) : void
frequency int
duration int
리턴 void

Clear() 공개 정적인 메소드

public static Clear ( ) : void
리턴 void

IsErrorRedirectedCore() 공개 정적인 메소드

Gets whether Console.In is targeting a terminal display.
public static IsErrorRedirectedCore ( ) : bool
리턴 bool

IsInputRedirectedCore() 공개 정적인 메소드

Gets whether Console.In is targeting a terminal display.
public static IsInputRedirectedCore ( ) : bool
리턴 bool

IsOutputRedirectedCore() 공개 정적인 메소드

Gets whether Console.Out is targeting a terminal display.
public static IsOutputRedirectedCore ( ) : bool
리턴 bool

MoveBufferArea() 공개 정적인 메소드

public static MoveBufferArea ( int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop ) : void
sourceLeft int
sourceTop int
sourceWidth int
sourceHeight int
targetLeft int
targetTop int
리턴 void

MoveBufferArea() 공개 정적인 메소드

public static MoveBufferArea ( int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor ) : void
sourceLeft int
sourceTop int
sourceWidth int
sourceHeight int
targetLeft int
targetTop int
sourceChar char
sourceForeColor ConsoleColor
sourceBackColor ConsoleColor
리턴 void

OpenStandardError() 공개 정적인 메소드

public static OpenStandardError ( ) : Stream
리턴 Stream

OpenStandardInput() 공개 정적인 메소드

public static OpenStandardInput ( ) : Stream
리턴 Stream

OpenStandardOutput() 공개 정적인 메소드

public static OpenStandardOutput ( ) : Stream
리턴 Stream

ReadKey() 공개 정적인 메소드

public static ReadKey ( bool intercept ) : ConsoleKeyInfo
intercept bool
리턴 ConsoleKeyInfo

ResetColor() 공개 정적인 메소드

public static ResetColor ( ) : void
리턴 void

SetConsoleInputEncoding() 공개 정적인 메소드

public static SetConsoleInputEncoding ( Encoding enc ) : void
enc System.Text.Encoding
리턴 void

SetConsoleOutputEncoding() 공개 정적인 메소드

public static SetConsoleOutputEncoding ( Encoding enc ) : void
enc System.Text.Encoding
리턴 void

SetCursorPosition() 공개 정적인 메소드

public static SetCursorPosition ( int left, int top ) : void
left int
top int
리턴 void

SetWindowPosition() 공개 정적인 메소드

public static SetWindowPosition ( int left, int top ) : void
left int
top int
리턴 void

SetWindowSize() 공개 정적인 메소드

public static SetWindowSize ( int width, int height ) : void
width int
height int
리턴 void

TryGetSpecialConsoleKey() 공개 정적인 메소드

public static TryGetSpecialConsoleKey ( char givenChars, int startIndex, int endIndex, ConsoleKeyInfo &key, int &keyLength ) : bool
givenChars char
startIndex int
endIndex int
key ConsoleKeyInfo
keyLength int
리턴 bool