1 //------------------------------------------------------------------------------
\r
3 // System.OperatingSystem.cs
\r
5 // Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
\r
7 // Author: Jim Richardson, develop@wtfo-guru.com
\r
8 // Created: Saturday, August 11, 2001
\r
10 //------------------------------------------------------------------------------
\r
13 using System.Globalization;
\r
18 /// Class representing a specific operating system version for a specific platform
\r
21 public sealed class OperatingSystem : ICloneable
\r
23 private System.PlatformID itsPlatform;
\r
24 private Version itsVersion;
\r
26 public OperatingSystem(PlatformID platform, Version version)
\r
30 throw new ArgumentNullException();
\r
33 itsPlatform = platform;
\r
34 itsVersion = version;
\r
38 /// Get the PlatformID
\r
40 public PlatformID Platform
\r
49 /// Gets the version object
\r
51 public Version Version
\r
60 /// Return a clone of this object
\r
62 public object Clone()
\r
64 return new OperatingSystem(itsPlatform, itsVersion);
\r
68 /// Return a string reprentation of this instance
\r
70 public override string ToString()
\r
74 switch((int) itsPlatform)
\r
76 case (int) System.PlatformID.Win32NT: str = "Microsoft Windows NT"; break;
\r
77 case (int) System.PlatformID.Win32S: str = "Microsoft Win32S"; break;
\r
78 case (int) System.PlatformID.Win32Windows: str = "Microsoft Windows 98"; break;
\r
79 case 128 /* PlatformID.Unix */: str = "Unix"; break;
\r
80 default: str = Locale.GetText ("<unknown>"); break;
\r
83 return str + " " + itsVersion.ToString();
\r