singrdk/base/Applications/Runtime/Full/System/Environment.cs

72 lines
2.4 KiB
C#
Raw Normal View History

2008-03-05 09:52:00 -05:00
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
2008-11-17 18:29:00 -05:00
//============================================================
//
// Class: Environment
//
// Purpose: Provides some basic access to some environment
// functionality.
//
//============================================================
namespace System
{
2008-03-05 09:52:00 -05:00
using System.Globalization;
using System.Collections;
using System.Text;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Reflection;
using System.Diagnostics;
using Microsoft.Singularity;
using Microsoft.Singularity.V1.Services;
//| <include path='docs/doc[@for="Environment"]/*' />
public sealed class Environment {
private Environment() {} // Prevent from begin created
2008-11-17 18:29:00 -05:00
//==================================TickCount===================================
//Action: Gets the number of ticks since the system was started.
//Returns: The number of ticks since the system was started.
//Arguments: None
//Exceptions: None
//==============================================================================
2008-03-05 09:52:00 -05:00
//| <include path='docs/doc[@for="Environment.TickCount"]/*' />
public static int TickCount {
get {
return unchecked((int)(ProcessService.GetUpTime().Ticks / 10000));
}
}
2008-11-17 18:29:00 -05:00
//===================================NewLine====================================
//Action: A property which returns the appropriate newline string for the given
// platform.
//Returns: \r\n on Win32.
//Arguments: None.
//Exceptions: None.
//==============================================================================
2008-03-05 09:52:00 -05:00
//| <include path='docs/doc[@for="Environment.NewLine"]/*' />
public static String NewLine {
get {
return "\r\n";
}
}
//| <include path='docs/doc[@for="Environment.Exit"]/*' />
public static void Exit(int exitCode) {
ProcessService.Stop(exitCode);
}
2008-11-17 18:29:00 -05:00
// [Bartok]:
2008-03-05 09:52:00 -05:00
public static String StackTrace
{
get {
return "<no.stack.trace";
}
}
}
}