PageRenderTime 24ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/mcs/tools/monodoc/Lucene.Net/Lucene.Net/Util/Constants.cs

https://github.com/hollow87/mono
C# | 52 lines | 18 code | 3 blank | 31 comment | 0 complexity | 5d8efbb0f7c386af29ae70bbe78b6aa8 MD5 | raw file
  1. /*
  2. * Copyright 2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. using System;
  17. namespace Monodoc.Lucene.Net.Util
  18. {
  19. /// <summary> Some useful constants.
  20. ///
  21. /// </summary>
  22. /// <author> Doug Cutting
  23. /// </author>
  24. /// <version> $Id: Constants.java,v 1.3 2004/03/29 22:48:05 cutting Exp $
  25. ///
  26. /// </version>
  27. public sealed class Constants
  28. {
  29. private Constants()
  30. {
  31. } // can't construct
  32. /// <summary>The value of <tt>System.getProperty("java.version")<tt>. *</summary>
  33. public static readonly System.String JAVA_VERSION = System.Configuration.ConfigurationSettings.AppSettings.Get("java.version");
  34. /// <summary>True iff this is Java version 1.1. </summary>
  35. public static readonly bool JAVA_1_1 = JAVA_VERSION.StartsWith("1.1.");
  36. /// <summary>True iff this is Java version 1.2. </summary>
  37. public static readonly bool JAVA_1_2 = JAVA_VERSION.StartsWith("1.2.");
  38. /// <summary>True iff this is Java version 1.3. </summary>
  39. public static readonly bool JAVA_1_3 = JAVA_VERSION.StartsWith("1.3.");
  40. /// <summary>The value of <tt>System.getProperty("os.name")<tt>. *</summary>
  41. public static readonly System.String OS_NAME = System.Environment.GetEnvironmentVariable("OS");
  42. /// <summary>True iff running on Linux. </summary>
  43. public static readonly bool LINUX = OS_NAME.StartsWith("Linux");
  44. /// <summary>True iff running on Windows. </summary>
  45. public static readonly bool WINDOWS = OS_NAME.StartsWith("Windows");
  46. /// <summary>True iff running on SunOS. </summary>
  47. public static readonly bool SUN_OS = OS_NAME.StartsWith("SunOS");
  48. }
  49. }