Skip to content

c7646a55 6142 0d6a 9e37 cb86c5ffd02a

Axel Kesseler edited this page Mar 1, 2023 · 15 revisions

SystemConsoleWrapper Class

This class provides native access to the console window.

Inheritance Hierarchy

System.Object
  Plexdata.LogWriter.Internals.Native.Windows.SystemConsoleWrapper
Namespace: Plexdata.LogWriter.Internals.Native.Windows
Assembly: Plexdata.LogWriter.Console.Windows (in Plexdata.LogWriter.Console.Windows.dll) Version: 1.0.7.1

Syntax

C#

internal class SystemConsoleWrapper

The SystemConsoleWrapper type exposes the following members.

Constructors

 

Name Description
Private methodStatic member SystemConsoleWrapper The static class constructor.
Private method SystemConsoleWrapper The private default constructor just initializes almost all properties with its default values.
  Back to Top

Properties

 

Name Description
Public property Background Gets or sets the background color to be used.
Public property BufferSize Gets or sets the number of lines and columns of the underlying console screen buffer.
Public property Foreground Gets or sets the text color to be used.
Public propertyStatic member Instance Gets the singleton instance of this class.
Public property IsAttached Gets current attach state of the console window.
Public property MustDetach Gets the state if the console window must be detached.
Public property QuickEdit Enables or disables the Quick Edit Mode of current console window.
Public property References Gets current number of referenced instances.
Public property UseColors Determines if message coloring should be used or not.
Public property WindowTitle Gets and sets the title of the console window.
  Back to Top

Methods

 

Name Description
Public method Attach This method safely tries to attach a console window.
Private method Decrement This method decrements the internal reference counter.
Public method Detach This method safely tries to detach a console window.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize The class destructor. (Overrides Object.Finalize().)
Private method GetBackgroundColorFlags Gets the bitwise combination of requested background color.
Private method GetConsoleColorFlags Gets the bitwise combination of current foreground and background color.
Private method GetForegroundColorFlags Gets the bitwise combination of requested foreground color.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Private method GetQuickEditMode This method gets currently applied Quick Edit Mode.
Private method GetScreenBufferSize This method gets currently applied screen buffer size.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Private method GetWindowTitle The method gets the title of current console window.
Private method Increment This method increments the internal reference counter.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Private method RestoreConsoleAttributes This method changes all of the console screen buffer attributes.
Private method SetConsoleColor This method changes current console colors into requested colors.
Private method SetQuickEditMode This method sets currently applied Quick Edit Mode.
Private method SetScreenBufferSize This method sets currently applied screen buffer size.
Private method SetWindowTitle The method sets the title of current console window.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Write This method writes provided message into the attached console window.
Private method WriteNative Writes provided message out to console screen buffer.
Private method WriteStyled Writes provided message out to console screen buffer by using currently applied styles.
  Back to Top

Fields

 

Name Description
Private field hOutput This field holds the native file handle to the output stream.
Private field inputName This field holds the file name of the standard input stream.
Private fieldStatic member instance This field holds the singleton instance of this class.
Private field interlock This field holds the instance of the internal synchronization object.
Private field outputName This field holds the file name of the standard output stream.
  Back to Top

Remarks

Please be aware, this class cannot be used on platforms other than Windows! This is because of this class uses the Win32-API to accomplish its tasks.

See Also

Reference

Plexdata.LogWriter.Internals.Native.Windows Namespace

Clone this wiki locally