• NeonSDK
  • NeonKUBE
Search Results for

    Show / Hide Table of Contents
    • Neon
      • Build
    • Neon.Blazor
      • BlazorHelper
      • BodyOutlet
      • ClientRenderContext
      • DOMRectReadOnly
      • EventHandlers
      • FileDownloader
      • HtmlElement
      • IRenderContext
      • IntersectionChangedEventArgs
      • IntersectionObserver
      • IntersectionObserverContext
      • MobileDetector
      • NeonBlazorExtensions
      • ServerRenderContext
      • SwipeDirection
      • SwipeHandler
    • Neon.Blazor.Analyzers
      • SvgGenerator
      • SvgGenerator.Svg
    • Neon.BuildInfo
      • ThisAssembly
      • ThisAssembly.Git
      • ThisAssembly.Git.BaseVersion
      • ThisAssembly.Git.SemVer
    • Neon.CSharp
      • CSharpHelper
      • CompilerErrorException
      • MetadataReferences
    • Neon.Cassandra
      • KeyspaceStatus
      • RowSetExtensions
      • SchemaManager
      • SchemaManagerException
      • SchemaStatus
      • SessionExtensions
    • Neon.Collections
      • ArgDictionary
      • Bits
      • IObjectDictionary
      • NiceDictionary<TKey, TValue>
      • ObjectDictionary
    • Neon.Common
      • AppDomainExtensions
      • Block
      • BlockArray
      • ByteEncoding
      • ByteUnits
      • CommandLine
      • CommandLine.OptionDefinition
      • CommandLine.Redactor
      • CpuArchitecture
      • Credentials
      • DateTimeExtensions
      • EnumExtensions
      • EnvironmentParser
      • EnvironmentParser.Parser<T>
      • EnvironmentParser.Validator<T>
      • EnvironmentParser.VariableSource
      • ExceptionExtensions
      • ExecuteException
      • ExecuteResponse
      • GlobPattern
      • HexDumpOption
      • HttpClientExtensions
      • HttpResponseMessageExtensions
      • IEnumerableExtensions
      • ILabeled
      • IOExtensions
      • IServiceContainer
      • IStaticDirectoryExtensions
      • LabelSelector
      • LabelSelectorOptions
      • LabelSelector<TItem>
      • NeonAssemblyExtensions
      • NeonExtendedHelper
      • NeonHelper
      • NetFramework
      • NewtonsoftExtensions
      • NotReadyException
      • ProcessExtensions
      • ProgramEntrypoint
      • ProgramEntrypointAsync
      • ProgramExitException
      • ProgramRunner
      • RandomExtensions
      • ReflectionExtensions
      • SemanticVersion
      • ServiceContainer
      • StaticZipOptions
      • StringBuilderExtensions
      • StringExtensions
      • Stub
      • Stub.Value
      • TaskExtensions
      • TimeSpanExtensions
      • ToolException
      • TriState
      • WeakEventController
      • WindowsEdition
      • WindowsFeatureStatus
      • YamlDotNetExtensions
    • Neon.Cryptography
      • AesCipher
      • CryptoExtensions
      • CryptoHelper
      • NeonVault
      • Wildcard
    • Neon.Csv
      • CsvReader
      • CsvTableReader
      • CsvTableWriter
      • CsvWriter
    • Neon.Data
      • DateTimeJsonConverter
      • DateTimeOffsetJsonConverter
      • IEnhancedJsonConverter
      • IGeneratedServiceClient
      • IPersistableType
      • IPersistableType<T>
      • IRoundtripData
      • IntegerEnumConverter<TEnum>
      • NotifyPropertyChanged
      • RoundtripDataFactory
      • RoundtripDataHelper
      • TimeSpanJsonConverter
      • VersionJsonConverter
    • Neon.Deployment
      • AwsCli
      • DeploymentException
      • DeploymentHelper
      • DownloadManifest
      • DownloadPart
      • DownloadProgressDelegate
      • DownloadProgressType
      • GitHub
      • GitHubActionsApi
      • GitHubPackage
      • GitHubPackageApi
      • GitHubPackageType
      • GitHubPackageVersion
      • GitHubPackageVisibility
      • GitHubReleaseApi
      • GitHubRepoPath
      • GitHubTagApi
      • IProfileClient
      • IProfileRequest
      • IProfileResponse
      • MaintainerProfile
      • NotifyClient
      • OnePassword
      • OnePasswordException
      • ProfileException
      • ProfileHandlerResult
      • ProfileRequest
      • ProfileResponse
      • ProfileServer
      • ProfileStatus
      • XenServer
    • Neon.Deployment.CodeSigning
      • AzureProfile
      • CodeSigner
      • UsbTokenProfile
    • Neon.Diagnostics
      • AssertException
      • ConfigExtensions
      • ConsoleJsonLogExporter
      • ConsoleJsonLogExporterOptions
      • ConsoleTextLogExporter
      • ConsoleTextLogExporterOptions
      • ExceptionInfo
      • FileLogExporter
      • FileLogExporterFormat
      • FileLogExporterOptions
      • LogAsTraceProcessor
      • LogAsTraceProcessorOptions
      • LogAttributeNames
      • LogAttributes
      • LogEvent
      • LogEventInterceptor
      • LoggerExtensions
      • NullLogger
      • TelemetryHub
      • TelemetrySpanEventNames
      • TelemetrySpanExtensions
    • Neon.Docker
      • DockerClient
      • DockerNetwork
      • DockerNetworkContainer
      • DockerNetworkIpam
      • DockerNode
      • DockerNodeManagerStatus
      • DockerResponse
      • DockerSettings
      • DockerVolume
      • NetworkCreateResponse
      • ServiceBindOptions
      • ServiceConfig
      • ServiceContainerSpec
      • ServiceCredentialSpec
      • ServiceDetails
      • ServiceDiscreteResourceSpec
      • ServiceDnsConfig
      • ServiceEndpoint
      • ServiceEndpointMode
      • ServiceEndpointPortConfig
      • ServiceEndpointSpec
      • ServiceFile
      • ServiceGenericResources
      • ServiceGlobalSchedulingMode
      • ServiceHealthCheck
      • ServiceIsolationMode
      • ServiceListResponse
      • ServiceLogDriver
      • ServiceMode
      • ServiceMount
      • ServiceMountBindPropagation
      • ServiceMountConsistency
      • ServiceMountType
      • ServiceNamedResourceSpec
      • ServiceNetwork
      • ServicePlacement
      • ServicePlacementPreferences
      • ServicePlacementSpreadSettings
      • ServicePlatform
      • ServicePortMode
      • ServicePortProtocol
      • ServicePrivileges
      • ServiceReplicatedSchedulingMode
      • ServiceResourceSettings
      • ServiceResources
      • ServiceRestartCondition
      • ServiceRestartPolicy
      • ServiceRollbackConfig
      • ServiceRollbackFailureAction
      • ServiceRollbackOrder
      • ServiceSELinuxContext
      • ServiceSchedulingMode
      • ServiceSecret
      • ServiceSpec
      • ServiceTaskTemplate
      • ServiceTmpfsOptions
      • ServiceUpdateConfig
      • ServiceUpdateFailureAction
      • ServiceUpdateOrder
      • ServiceUpdateState
      • ServiceUpdateStatus
      • ServiceVersion
      • ServiceVirtualIP
      • ServiceVolumeDriverConfig
      • ServiceVolumeOptions
      • VolumeListResponse
    • Neon.GitHub
      • GitExtensions
      • GitHubCredentials
      • GitHubRepo
      • LocalRepoApi
      • NoLocalRepositoryException
      • RemoteRepoApi
      • RemoteRepoBranchApi
      • RemoteRepoIssueApi
      • RemoteRepoIssueCommentApi
      • RemoteRepoPath
      • RemoteRepoReleaseApi
      • RemoteRepoTagApi
    • Neon.HyperV
      • HyperVClient
      • HyperVDriverType
      • HyperVException
      • NetAdapter
      • VirtualDrive
      • VirtualIPAddress
      • VirtualMachine
      • VirtualMachineNetworkAdapter
      • VirtualMachineState
      • VirtualNat
      • VirtualSwitch
      • VirtualSwitchType
    • Neon.IO
      • BlockStream
      • FixedLengthStream
      • IStaticDirectory
      • IStaticFile
      • LineEnding
      • LinuxPath
      • LinuxPermissions
      • PreprocessReader
      • RelayStream
      • StaticDirectoryBase
      • StaticFileBase
      • SubStream
      • TempFile
      • TempFolder
    • Neon.JsonConverters
      • JsonDateTimeConverter
      • JsonGenericConverter<T>
      • JsonNullableDateTimeConverter
    • Neon.ModelGen
      • ActionResult<T>
      • ApiVersion
      • ApiVersionAttribute
      • BodyStreamAttribute
      • ControllerValidationAttribute
      • DataModelAttribute
      • EnumMember
      • FromBodyAttribute
      • FromHeaderAttribute
      • FromQueryAttribute
      • FromRouteAttribute
      • GeneratedClientAttribute
      • GeneratedMethodAttribute
      • GeneratedParamAttribute
      • HashSourceAttribute
      • HttpAttribute
      • HttpDeleteAttribute
      • HttpGetAttribute
      • HttpHeadAttribute
      • HttpOptionsAttribute
      • HttpPatchAttribute
      • HttpPostAttribute
      • HttpPutAttribute
      • IActionResult
      • ModelGenerator
      • ModelGeneratorOutput
      • ModelGeneratorSettings
      • NoCodeGenAttribute
      • NoControllerValidationAttribute
      • PassAs
      • PersistableAttribute
      • PersistableKeyAttribute
      • RouteAttribute
      • ServiceModelAttribute
      • TargetAttribute
      • UxFrameworks
    • Neon.Net
      • HttpApiException
      • HttpException
      • JsonClient
      • JsonClientPayload
      • JsonResponse
      • Jwt
      • LocalHostSection
      • NetConst
      • NetHelper
      • NetworkCidr
      • NetworkConfiguration
      • NetworkException
      • NetworkPorts
      • Pinger
      • ReachableHost
      • ReachableHostMode
      • StreamDocument
    • Neon.Postgres
      • ConnectionExtensions
      • DatabaseStatus
      • PreparedCommand
      • ReaderAsyncEnumerator
      • ReaderEnumerator
      • ReaderExtensions
      • SchemaManager
      • SchemaManagerException
      • SchemaStatus
    • Neon.Retry
      • ExponentialRetryPolicy
      • IRetryPolicy
      • LinearRetryPolicy
      • NoRetryPolicy
      • RetryPolicy
      • RetryPolicyBase
      • RetryTransientArgs
      • TransientDetector
      • TransientException
    • Neon.Roslyn
      • DisplayFormat
      • DocumentationComment
      • DocumentationItem
      • MetadataLoadContext
      • RoslynAssembly
      • RoslynConstructorInfo
      • RoslynCustomAttributeData
      • RoslynExtensions
      • RoslynFieldInfo
      • RoslynMethodInfo
      • RoslynParameterInfo
      • RoslynPropertyInfo
      • RoslynType
      • SharedUtilities
    • Neon.Roslyn.Xunit
      • AdditionalSourceText
      • CompilationOptions
      • CompilationOptionsProvider
      • TestCompilation
      • TestCompilationAssertions
      • TestCompilationBuilder
      • TestCompilationBuilderExtensions
      • TestCompilationExtensions
    • Neon.SSH
      • CommandBundle
      • CommandFile
      • CommandResponse
      • HostFolders
      • IBashCommandFormatter
      • ILinuxSshProxy
      • LinuxDiskInfo
      • LinuxDiskPartition
      • LinuxSshProxy
      • LinuxSshProxy<TMetadata>
      • NamespaceDoc
      • RemoteCommandException
      • RunOptions
      • SshCredentials
      • SshExtensions
      • SshProxyException
    • Neon.Service
      • LogMetricsProcessor
      • MetricsMode
      • MetricsOptions
      • NeonService
      • NeonServiceOptions
      • NeonServiceStatus
      • OtelConfigExtensions
      • OtlpCollectorChecker
      • ProcessTerminator
      • ServiceApiContact
      • ServiceApiInfo
      • ServiceApiLicense
      • ServiceDependencies
      • ServiceDescription
      • ServiceEndpoint
      • ServiceEndpointProtocol
      • ServiceEndpoints
      • ServiceMap
    • Neon.SignalR
      • DependencyInjectionExtensions
      • DnsCache
      • GroupAction
      • GroupCommand
      • IDnsCache
      • Invocation
      • NatsHubLifetimeManager<THub>
      • ProxyConfig
      • ServiceCollectionExtensions
      • ServiceDiscovey
      • SignalrProxyMiddleware
      • SignalrProxyMiddlewareExtensions
      • TracerProviderBuilderExtensions
    • Neon.Tailwind
      • ClickOffEventHandler
      • ComponentEventArgs<TSender>
      • ComponentEventArgs<TSender, TEventArgs>
      • DisclosureState
      • EventHandlerComponentBase<TComponent>
      • HeadlessButton
      • HeadlessDialog
      • HeadlessDialogPanel
      • HeadlessDisclosure
      • HeadlessDisclosureButton
      • HeadlessDisclosurePanel
      • HeadlessListboxButton<TValue>
      • HeadlessListboxLabel<TValue>
      • HeadlessListboxOption<TValue>
      • HeadlessListboxOptions<TValue>
      • HeadlessListbox<TValue>
      • HeadlessMenu
      • HeadlessMenuButton
      • HeadlessMenuItem
      • HeadlessMenuItems
      • HeadlessSwitch
      • HeadlessSwitchGroup
      • HeadlessSwitchLabel
      • IPortalBinder
      • KeyDownEventHandler
      • KeyboardKey
      • ListboxFocus
      • ListboxState
      • MenuFocus
      • MenuState
      • Portal
      • PortalBinder
      • PortalContent
      • SearchAssistant
      • TailwindExtensions
      • Transition
      • TransitionGroup
      • TransitionState
    • Neon.Tasks
      • Async
      • AsyncAutoResetEvent
      • AsyncManualResetEvent
      • AsyncMutex
      • AsyncPeriodicTask
      • AsyncReaderWriterLock
      • AsyncReentrantMutex
      • AsyncTimer
      • IAsyncFuture
      • IAsyncFuture<T>
      • NonDisposableTask
      • NonDisposableTask<T>
      • SyncContext
      • SyncContextMode
    • Neon.Temporal
      • ActivityHelper
      • ActivityLogEnricher
      • TemporalEnricherTagNames
      • WorkflowLogEnricher
    • Neon.Time
      • GatedTimer
      • GoDuration
      • PolledTimer
      • RecurringTimer
      • RecurringTimerType
      • SysTime
      • TimeOfDay
    • Neon.WSL
      • Wsl2Proxy
    • Neon.Web
      • AesProtector
      • DataProtectionExtensions
      • NeonController
      • NeonControllerBase
      • RoundTripJsonInputFormatter
      • RoundTripJsonOutputFormatter
      • TracerProviderBuilderExtensions
      • WebHelper
    • Neon.WinTTY
      • ConsoleTTY
    • Neon.Windows
      • MEMORYSTATUSEX
      • PowerShellException
      • Win32
    • Neon.XenServer
      • IXenClient
      • XenClient
      • XenClient.MachineOperations
      • XenClient.StorageOperations
      • XenClient.TemplateOperations
      • XenException
      • XenHostInfo
      • XenObject
      • XenResponse
      • XenStorageRepository
      • XenTempIso
      • XenTemplate
      • XenVirtualDisk
      • XenVirtualMachine
      • XenVmPowerState
    • Neon.Xunit
      • AnsiblePlayResults
      • AnsiblePlayer
      • AnsibleTaskResult
      • AspNetFixture
      • BasicFixture
      • CodeFixture
      • CollectionComparer<T>
      • ComposedFixture
      • ContainerFixture
      • ContainerLimits
      • DockerComposeFixture
      • DockerFixture
      • DockerFixture.ConfigInfo
      • DockerFixture.ContainerInfo
      • DockerFixture.NetworkInfo
      • DockerFixture.SecretInfo
      • DockerFixture.ServiceInfo
      • DockerFixture.StackDefinition
      • DockerFixture.StackInfo
      • DockerFixture.StackService
      • EnvironmentFixture
      • HostsFixture
      • ITestFixture
      • IncompatibleServiceException
      • MaintainerFactAttribute
      • MaintainerTheoryAttribute
      • MockHttpServer
      • MockHttpServerExtensions
      • NatsFixture
      • NatsStreamingFixture
      • NeonServiceFixture<TService>
      • PlatformFactAttribute
      • RepeatAttribute
      • TargetPlatforms
      • TestArea
      • TestCollection
      • TestContext
      • TestFixture
      • TestFixtureStatus
      • TestHelper
      • TestHttpClient
      • TestOutputWriter
      • TestTrait
      • XunitExtensions
    • Neon.Xunit.YugaByte
      • YugaByteFixture
    • Neon.YugaByte
      • YugaByteHelper

    Class TestOutputWriter

    Wraps an Xunit.Abstractions.ITestOutputHelper with a TextWriter that can be used generate output in unit tests that will be included in the captured test log.

    note

    Only the Write(...) and WriteLine(...) methods are implemented.

    Inheritance
    object
    MarshalByRefObject
    TextWriter
    TestOutputWriter
    Namespace: Neon.Xunit
    Assembly: Neon.Xunit.dll
    Syntax
    public class TestOutputWriter : TextWriter
    Remarks

    To use this class, you'll need to obtain a Xunit.Abstractions.ITestOutputHelper instance from Xunit via dependency injection by adding a parameter to your test constructor and then creating a TestOutputWriter from it, like:

    public class MyTest : IClassFixture<AspNetFixture>
    {
        private AspNetFixture               fixture;
        private TestAspNetFixtureClient     client;
        private TestOutputWriter            testWriter;
    
    public Test_EndToEnd(AspNetFixture fixture, ITestOutputHelper outputHelper)
    {
        this.fixture    = fixture;
        this.testWriter = new TestOutputWriter(outputHelper);
    
        fixture.Start<Startup>(logWriter: testWriter, logLevel: Neon.Diagnostics.LogLevel.Debug);
    
        client = new TestAspNetFixtureClient()
        {
            BaseAddress = fixture.BaseAddress
        };
     }
    

    }

    Constructors

    TestOutputWriter(ITestOutputHelper)

    Constructor.

    Declaration
    public TestOutputWriter(ITestOutputHelper outputHelper)
    Parameters
    Type Name Description
    ITestOutputHelper outputHelper

    The test output helper.

    Exceptions
    Type Condition
    NotImplementedException

    Thrown for all methods except for Write(...) and WriteLine(...).

    Properties

    Encoding

    When overridden in a derived class, returns the character encoding in which the output is written.

    Declaration
    public override Encoding Encoding { get; }
    Property Value
    Type Description
    Encoding

    The character encoding in which the output is written.

    Overrides
    TextWriter.Encoding
    Exceptions
    Type Condition
    NotImplementedException

    Thrown for all methods except for Write(...) and WriteLine(...).

    Methods

    Flush()

    Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.

    Declaration
    public override void Flush()
    Overrides
    TextWriter.Flush()
    Exceptions
    Type Condition
    NotImplementedException

    Thrown for all methods except for Write(...) and WriteLine(...).

    FlushAsync()

    Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device.

    Declaration
    public override Task FlushAsync()
    Returns
    Type Description
    Task

    A task that represents the asynchronous flush operation.

    Overrides
    TextWriter.FlushAsync()
    Exceptions
    Type Condition
    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The writer is currently in use by a previous write operation.

    Write(bool)

    Writes the text representation of a Boolean value to the text stream.

    Declaration
    public override void Write(bool value)
    Parameters
    Type Name Description
    bool value

    The Boolean value to write.

    Overrides
    TextWriter.Write(bool)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(char)

    Writes a character to the text stream.

    Declaration
    public override void Write(char value)
    Parameters
    Type Name Description
    char value

    The character to write to the text stream.

    Overrides
    TextWriter.Write(char)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(char[])

    Writes a character array to the text stream.

    Declaration
    public override void Write(char[] buffer)
    Parameters
    Type Name Description
    char[] buffer

    The character array to write to the text stream.

    Overrides
    TextWriter.Write(char[])
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(char[], int, int)

    Writes a subarray of characters to the text stream.

    Declaration
    public override void Write(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    char[] buffer

    The character array to write data from.

    int index

    The character position in the buffer at which to start retrieving data.

    int count

    The number of characters to write.

    Overrides
    TextWriter.Write(char[], int, int)
    Exceptions
    Type Condition
    ArgumentException

    The buffer length minus index is less than count.

    ArgumentNullException

    The buffer parameter is null.

    ArgumentOutOfRangeException

    index or count is negative.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(decimal)

    Writes the text representation of a decimal value to the text stream.

    Declaration
    public override void Write(decimal value)
    Parameters
    Type Name Description
    decimal value

    The decimal value to write.

    Overrides
    TextWriter.Write(decimal)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(double)

    Writes the text representation of an 8-byte floating-point value to the text stream.

    Declaration
    public override void Write(double value)
    Parameters
    Type Name Description
    double value

    The 8-byte floating-point value to write.

    Overrides
    TextWriter.Write(double)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(int)

    Writes the text representation of a 4-byte signed integer to the text stream.

    Declaration
    public override void Write(int value)
    Parameters
    Type Name Description
    int value

    The 4-byte signed integer to write.

    Overrides
    TextWriter.Write(int)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(long)

    Writes the text representation of an 8-byte signed integer to the text stream.

    Declaration
    public override void Write(long value)
    Parameters
    Type Name Description
    long value

    The 8-byte signed integer to write.

    Overrides
    TextWriter.Write(long)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(object)

    Writes the text representation of an object to the text stream by calling the ToString method on that object.

    Declaration
    public override void Write(object value)
    Parameters
    Type Name Description
    object value

    The object to write.

    Overrides
    TextWriter.Write(object)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(float)

    Writes the text representation of a 4-byte floating-point value to the text stream.

    Declaration
    public override void Write(float value)
    Parameters
    Type Name Description
    float value

    The 4-byte floating-point value to write.

    Overrides
    TextWriter.Write(float)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(string)

    Writes a string to the text stream.

    Declaration
    public override void Write(string value)
    Parameters
    Type Name Description
    string value

    The string to write.

    Overrides
    TextWriter.Write(string)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(string, object)

    Writes a formatted string to the text stream, using the same semantics as the Format(string, object) method.

    Declaration
    public override void Write(string format, object arg0)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object arg0

    The object to format and write.

    Overrides
    TextWriter.Write(string, object)
    Exceptions
    Type Condition
    ArgumentNullException

    format is null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is one).

    Write(string, object, object)

    Writes a formatted string to the text stream using the same semantics as the Format(string, object, object) method.

    Declaration
    public override void Write(string format, object arg0, object arg1)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object arg0

    The first object to format and write.

    object arg1

    The second object to format and write.

    Overrides
    TextWriter.Write(string, object, object)
    Exceptions
    Type Condition
    ArgumentNullException

    format is null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero) or greater than or equal to the number of objects to be formatted (which, for this method overload, is two).

    Write(string, object, object, object)

    Writes a formatted string to the text stream, using the same semantics as the Format(string, object, object, object) method.

    Declaration
    public override void Write(string format, object arg0, object arg1, object arg2)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object arg0

    The first object to format and write.

    object arg1

    The second object to format and write.

    object arg2

    The third object to format and write.

    Overrides
    TextWriter.Write(string, object, object, object)
    Exceptions
    Type Condition
    ArgumentNullException

    format is null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is three).

    Write(string, params object[])

    Writes a formatted string to the text stream, using the same semantics as the Format(string, params object[]) method.

    Declaration
    public override void Write(string format, params object[] arg)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object[] arg

    An object array that contains zero or more objects to format and write.

    Overrides
    TextWriter.Write(string, params object[])
    Exceptions
    Type Condition
    ArgumentNullException

    format or arg is null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero), or greater than or equal to the length of the arg array.

    Write(uint)

    Writes the text representation of a 4-byte unsigned integer to the text stream.

    Declaration
    public override void Write(uint value)
    Parameters
    Type Name Description
    uint value

    The 4-byte unsigned integer to write.

    Overrides
    TextWriter.Write(uint)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    Write(ulong)

    Writes the text representation of an 8-byte unsigned integer to the text stream.

    Declaration
    public override void Write(ulong value)
    Parameters
    Type Name Description
    ulong value

    The 8-byte unsigned integer to write.

    Overrides
    TextWriter.Write(ulong)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteAsync(char)

    Writes a character to the text stream asynchronously.

    Declaration
    public override Task WriteAsync(char value)
    Parameters
    Type Name Description
    char value

    The character to write to the text stream.

    Returns
    Type Description
    Task

    A task that represents the asynchronous write operation.

    Overrides
    TextWriter.WriteAsync(char)
    Exceptions
    Type Condition
    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The text writer is currently in use by a previous write operation.

    WriteAsync(char[], int, int)

    Writes a subarray of characters to the text stream asynchronously.

    Declaration
    public override Task WriteAsync(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    char[] buffer

    The character array to write data from.

    int index

    The character position in the buffer at which to start retrieving data.

    int count

    The number of characters to write.

    Returns
    Type Description
    Task

    A task that represents the asynchronous write operation.

    Overrides
    TextWriter.WriteAsync(char[], int, int)
    Exceptions
    Type Condition
    ArgumentNullException

    buffer is null.

    ArgumentException

    The index plus count is greater than the buffer length.

    ArgumentOutOfRangeException

    index or count is negative.

    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The text writer is currently in use by a previous write operation.

    WriteAsync(string)

    Writes a string to the text stream asynchronously.

    Declaration
    public override Task WriteAsync(string value)
    Parameters
    Type Name Description
    string value

    The string to write. If value is null, nothing is written to the text stream.

    Returns
    Type Description
    Task

    A task that represents the asynchronous write operation.

    Overrides
    TextWriter.WriteAsync(string)
    Exceptions
    Type Condition
    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The text writer is currently in use by a previous write operation.

    WriteLine()

    Writes a line terminator to the text stream.

    Declaration
    public override void WriteLine()
    Overrides
    TextWriter.WriteLine()
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(bool)

    Writes the text representation of a Boolean value to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(bool value)
    Parameters
    Type Name Description
    bool value

    The Boolean value to write.

    Overrides
    TextWriter.WriteLine(bool)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(char)

    Writes a character to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(char value)
    Parameters
    Type Name Description
    char value

    The character to write to the text stream.

    Overrides
    TextWriter.WriteLine(char)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(char[])

    Writes an array of characters to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(char[] buffer)
    Parameters
    Type Name Description
    char[] buffer

    The character array from which data is read.

    Overrides
    TextWriter.WriteLine(char[])
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(char[], int, int)

    Writes a subarray of characters to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    char[] buffer

    The character array from which data is read.

    int index

    The character position in buffer at which to start reading data.

    int count

    The maximum number of characters to write.

    Overrides
    TextWriter.WriteLine(char[], int, int)
    Exceptions
    Type Condition
    ArgumentException

    The buffer length minus index is less than count.

    ArgumentNullException

    The buffer parameter is null.

    ArgumentOutOfRangeException

    index or count is negative.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(decimal)

    Writes the text representation of a decimal value to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(decimal value)
    Parameters
    Type Name Description
    decimal value

    The decimal value to write.

    Overrides
    TextWriter.WriteLine(decimal)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(double)

    Writes the text representation of a 8-byte floating-point value to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(double value)
    Parameters
    Type Name Description
    double value

    The 8-byte floating-point value to write.

    Overrides
    TextWriter.WriteLine(double)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(int)

    Writes the text representation of a 4-byte signed integer to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(int value)
    Parameters
    Type Name Description
    int value

    The 4-byte signed integer to write.

    Overrides
    TextWriter.WriteLine(int)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(long)

    Writes the text representation of an 8-byte signed integer to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(long value)
    Parameters
    Type Name Description
    long value

    The 8-byte signed integer to write.

    Overrides
    TextWriter.WriteLine(long)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(object)

    Writes the text representation of an object to the text stream, by calling the ToString method on that object, followed by a line terminator.

    Declaration
    public override void WriteLine(object value)
    Parameters
    Type Name Description
    object value

    The object to write. If value is null, only the line terminator is written.

    Overrides
    TextWriter.WriteLine(object)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(float)

    Writes the text representation of a 4-byte floating-point value to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(float value)
    Parameters
    Type Name Description
    float value

    The 4-byte floating-point value to write.

    Overrides
    TextWriter.WriteLine(float)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(string)

    Writes a string to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(string value)
    Parameters
    Type Name Description
    string value

    The string to write. If value is null, only the line terminator is written.

    Overrides
    TextWriter.WriteLine(string)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(string, object)

    Writes a formatted string and a new line to the text stream, using the same semantics as the Format(string, object) method.

    Declaration
    public override void WriteLine(string format, object arg0)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object arg0

    The object to format and write.

    Overrides
    TextWriter.WriteLine(string, object)
    Exceptions
    Type Condition
    ArgumentNullException

    format is null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is one).

    WriteLine(string, object, object)

    Writes a formatted string and a new line to the text stream, using the same semantics as the Format(string, object, object) method.

    Declaration
    public override void WriteLine(string format, object arg0, object arg1)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object arg0

    The first object to format and write.

    object arg1

    The second object to format and write.

    Overrides
    TextWriter.WriteLine(string, object, object)
    Exceptions
    Type Condition
    ArgumentNullException

    format is null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is two).

    WriteLine(string, object, object, object)

    Writes out a formatted string and a new line to the text stream, using the same semantics as Format(string, object).

    Declaration
    public override void WriteLine(string format, object arg0, object arg1, object arg2)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object arg0

    The first object to format and write.

    object arg1

    The second object to format and write.

    object arg2

    The third object to format and write.

    Overrides
    TextWriter.WriteLine(string, object, object, object)
    Exceptions
    Type Condition
    ArgumentNullException

    format is null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is three).

    WriteLine(string, params object[])

    Writes out a formatted string and a new line to the text stream, using the same semantics as Format(string, object).

    Declaration
    public override void WriteLine(string format, params object[] arg)
    Parameters
    Type Name Description
    string format

    A composite format string.

    object[] arg

    An object array that contains zero or more objects to format and write.

    Overrides
    TextWriter.WriteLine(string, params object[])
    Exceptions
    Type Condition
    ArgumentNullException

    A string or object is passed in as null.

    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    FormatException

    format is not a valid composite format string.

    -or-

    The index of a format item is less than 0 (zero), or greater than or equal to the length of the arg array.

    WriteLine(uint)

    Writes the text representation of a 4-byte unsigned integer to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(uint value)
    Parameters
    Type Name Description
    uint value

    The 4-byte unsigned integer to write.

    Overrides
    TextWriter.WriteLine(uint)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLine(ulong)

    Writes the text representation of an 8-byte unsigned integer to the text stream, followed by a line terminator.

    Declaration
    public override void WriteLine(ulong value)
    Parameters
    Type Name Description
    ulong value

    The 8-byte unsigned integer to write.

    Overrides
    TextWriter.WriteLine(ulong)
    Exceptions
    Type Condition
    ObjectDisposedException

    The TextWriter is closed.

    IOException

    An I/O error occurs.

    WriteLineAsync()

    Asynchronously writes a line terminator to the text stream.

    Declaration
    public override Task WriteLineAsync()
    Returns
    Type Description
    Task

    A task that represents the asynchronous write operation.

    Overrides
    TextWriter.WriteLineAsync()
    Exceptions
    Type Condition
    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The text writer is currently in use by a previous write operation.

    WriteLineAsync(char)

    Asynchronously writes a character to the text stream, followed by a line terminator.

    Declaration
    public override Task WriteLineAsync(char value)
    Parameters
    Type Name Description
    char value

    The character to write to the text stream.

    Returns
    Type Description
    Task

    A task that represents the asynchronous write operation.

    Overrides
    TextWriter.WriteLineAsync(char)
    Exceptions
    Type Condition
    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The text writer is currently in use by a previous write operation.

    WriteLineAsync(char[], int, int)

    Asynchronously writes a subarray of characters to the text stream, followed by a line terminator.

    Declaration
    public override Task WriteLineAsync(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    char[] buffer

    The character array to write data from.

    int index

    The character position in the buffer at which to start retrieving data.

    int count

    The number of characters to write.

    Returns
    Type Description
    Task

    A task that represents the asynchronous write operation.

    Overrides
    TextWriter.WriteLineAsync(char[], int, int)
    Exceptions
    Type Condition
    ArgumentNullException

    buffer is null.

    ArgumentException

    The index plus count is greater than the buffer length.

    ArgumentOutOfRangeException

    index or count is negative.

    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The text writer is currently in use by a previous write operation.

    WriteLineAsync(string)

    Asynchronously writes a string to the text stream, followed by a line terminator.

    Declaration
    public override Task WriteLineAsync(string value)
    Parameters
    Type Name Description
    string value

    The string to write. If the value is null, only a line terminator is written.

    Returns
    Type Description
    Task

    A task that represents the asynchronous write operation.

    Overrides
    TextWriter.WriteLineAsync(string)
    Exceptions
    Type Condition
    ObjectDisposedException

    The text writer is disposed.

    InvalidOperationException

    The text writer is currently in use by a previous write operation.

    In this article
    Back to top © Copyright 2005-2023 by NEONFORGE LLC