The Labs \ Source Viewer \ SSCLI \ System \ UriKind

  1. //------------------------------------------------------------------------------
  2. // <copyright file="UriEnumTypes.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. /*++
  16. Abstract:
  17.     Defines enum types used by System.Uri class
  18. Author:
  19.     Alexei Vopilov    Nov 21 2003
  20. Revision History:
  21. --*/
  22. namespace System
  23. {
  24.    
  25.     // Used to control whether absolu
  26.     public enum UriKind
  27.     {
  28.         RelativeOrAbsolute = 0,
  29.         Absolute = 1,
  30.         Relative = 2
  31.     }
  32.    
  33.     [Flags()]
  34.     public enum UriComponents
  35.     {
  36.         // Generic parts.
  37.         // ATTN: The values must stay in sync with Uri.Flags.xxxNotCanonical
  38.         Scheme = 1,
  39.         UserInfo = 2,
  40.         Host = 4,
  41.         Port = 8,
  42.         Path = 16,
  43.         Query = 32,
  44.         Fragment = 64,
  45.        
  46.         StrongPort = 128,
  47.        
  48.         // This will also return respective delimiters for scheme, userinfo or port
  49.         // Valid only for a single componet requests.
  50.         KeepDelimiter = 1073741824,
  51.        
  52.         // This is used by GetObjectData and can also be used directly.
  53.         // Works for both absolute and relaitve Uris
  54.         SerializationInfoString = unchecked((int)2147483648u),
  55.        
  56.         // Shortcuts for general cases
  57.         AbsoluteUri = Scheme | UserInfo | Host | Port | Path | Query | Fragment,
  58.         HostAndPort = Host | StrongPort,
  59.         //includes port even if default
  60.         StrongAuthority = UserInfo | Host | StrongPort,
  61.         //includes port even if default
  62.         SchemeAndServer = Scheme | Host | Port,
  63.         HttpRequestUrl = Scheme | Host | Port | Path | Query,
  64.         PathAndQuery = Path | Query
  65.     }
  66.     public enum UriFormat
  67.     {
  68.         UriEscaped = 1,
  69.         Unescaped = 2,
  70.         // Completely unescaped.
  71.         SafeUnescaped = 3
  72.        
  73.     }
  74. }

Developer Fusion