mscorlib(4.0.0.0) API with additions
System.OperatingSystem Class Reference

Represents information about an operating system, such as the version and platform identifier. This class cannot be inherited. More...

Inheritance diagram for System.OperatingSystem:
[legend]
Collaboration diagram for System.OperatingSystem:
[legend]

Public Member Functions

 OperatingSystem (PlatformID platform, Version version)
 Initializes a new instance of the T:System.OperatingSystem class, using the specified platform identifier value and version object. More...
 
void GetObjectData (SerializationInfo info, StreamingContext context)
 Populates a T:System.Runtime.Serialization.SerializationInfo object with the data necessary to deserialize this instance. More...
 
object Clone ()
 Creates an T:System.OperatingSystem object that is identical to this instance. More...
 
override string ToString ()
 Converts the value of this T:System.OperatingSystem object to its equivalent string representation. More...
 

Public Attributes

PlatformID Platform => _platform
 Gets a T:System.PlatformID enumeration value that identifies the operating system platform. More...
 
Version Version => _version
 Gets a T:System.Version object that identifies the operating system. More...
 

Properties

string ServicePack [get]
 Gets the service pack version represented by this T:System.OperatingSystem object. More...
 
string? VersionString [get]
 Gets the concatenated string representation of the platform identifier, version, and service pack that are currently installed on the operating system. More...
 

Detailed Description

Represents information about an operating system, such as the version and platform identifier. This class cannot be inherited.

Definition at line 10 of file OperatingSystem.cs.

Constructor & Destructor Documentation

◆ OperatingSystem()

System.OperatingSystem.OperatingSystem ( PlatformID  platform,
Version  version 
)

Initializes a new instance of the T:System.OperatingSystem class, using the specified platform identifier value and version object.

Parameters
platformOne of the T:System.PlatformID values that indicates the operating system platform.
versionA T:System.Version object that indicates the version of the operating system.
Exceptions
T:System.ArgumentNullExceptionversion is null.
T:System.ArgumentExceptionplatform is not a T:System.PlatformID enumeration value.

Definition at line 97 of file OperatingSystem.cs.

Member Function Documentation

◆ Clone()

object System.OperatingSystem.Clone ( )

Creates an T:System.OperatingSystem object that is identical to this instance.

Returns
An T:System.OperatingSystem object that is a copy of this instance.

Implements System.ICloneable.

Definition at line 160 of file OperatingSystem.cs.

◆ GetObjectData()

void System.OperatingSystem.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)

Populates a T:System.Runtime.Serialization.SerializationInfo object with the data necessary to deserialize this instance.

Parameters
infoThe object to populate with serialization information.
contextThe place to store and retrieve serialized data. Reserved for future use.
Exceptions
T:System.ArgumentNullExceptioninfo is null.

Implements System.Runtime.Serialization.ISerializable.

Definition at line 147 of file OperatingSystem.cs.

◆ ToString()

override string System.OperatingSystem.ToString ( )

Converts the value of this T:System.OperatingSystem object to its equivalent string representation.

Returns
The string representation of the values returned by the P:System.OperatingSystem.Platform, P:System.OperatingSystem.Version, and P:System.OperatingSystem.ServicePack properties.

Definition at line 167 of file OperatingSystem.cs.

Member Data Documentation

◆ Platform

PlatformID System.OperatingSystem.Platform => _platform

Gets a T:System.PlatformID enumeration value that identifies the operating system platform.

Returns
One of the T:System.PlatformID values.

Definition at line 22 of file OperatingSystem.cs.

◆ Version

Version System.OperatingSystem.Version => _version

Gets a T:System.Version object that identifies the operating system.

Returns
A T:System.Version object that describes the major version, minor version, build, and revision numbers for the operating system.

Definition at line 40 of file OperatingSystem.cs.

Property Documentation

◆ ServicePack

string System.OperatingSystem.ServicePack
get

Gets the service pack version represented by this T:System.OperatingSystem object.

Returns
The service pack version, if service packs are supported and at least one is installed; otherwise, an empty string ("").

Definition at line 27 of file OperatingSystem.cs.

◆ VersionString

string? System.OperatingSystem.VersionString
get

Gets the concatenated string representation of the platform identifier, version, and service pack that are currently installed on the operating system.

Returns
The string representation of the values returned by the P:System.OperatingSystem.Platform, P:System.OperatingSystem.Version, and P:System.OperatingSystem.ServicePack properties.

Definition at line 45 of file OperatingSystem.cs.


The documentation for this class was generated from the following file: