The Labs \ Source Viewer \ SSCLI \ System.Configuration \ ExeContext

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ExeContext.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. using System;
  16. namespace System.Configuration
  17. {
  18.    
  19.     // ExeContext
  20.     //
  21.     // Represents the ExeContext that we are running within
  22.     //
  23.     public sealed class ExeContext
  24.     {
  25.         private ConfigurationUserLevel _userContext;
  26.         private string _exePath;
  27.        
  28.         // Constructor
  29.         //
  30.         // Constructor
  31.         //
  32.         internal ExeContext(ConfigurationUserLevel userContext, string exePath)
  33.         {
  34.             _userContext = userContext;
  35.             _exePath = exePath;
  36.         }
  37.        
  38.         // UserLevel
  39.         //
  40.         // The ConfigurationUserLevel that we are running within.
  41.         //
  42.         // Note: ConfigurationUserLevel.None will be set for machine.config
  43.         // and the applicationconfig file. Use IsMachineConfig in
  44.         // ConfigurationContext, to determine the difference.
  45.         //
  46.         public ConfigurationUserLevel UserLevel {
  47.             get { return _userContext; }
  48.         }
  49.        
  50.         // ExePath
  51.         //
  52.         // What is the full path to the exe that we are running for?
  53.         //
  54.         public string ExePath {
  55.             get { return _exePath; }
  56.         }
  57.     }
  58. }

Developer Fusion