The Labs \ Source Viewer \ SSCLI \ System.Runtime.CompilerServices \ DependencyAttribute

  1. // ==++==
  2. //
  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. //
  14. // ==--==
  15. ////////////////////////////////////////////////////////////////////////////////
  16. ////////////////////////////////////////////////////////////////////////////////
  17. namespace System.Runtime.CompilerServices
  18. {
  19.    
  20.     using System;
  21.     using System.Runtime.InteropServices;
  22.    
  23. /*
  24.     NGenHint is not supported in Whidbey   
  25.     [Serializable]
  26.     public enum NGenHint
  27.     {   
  28.         Default            = 0x0000, // No preference specified
  29.        
  30.         Eager              = 0x0001, // NGen at install time
  31.         Lazy                = 0x0002, // NGen after install time
  32.         Never              = 0x0003, // Assembly should not be ngened     
  33.     }
  34.     */   
  35.    
  36.     [Serializable()]
  37.     public enum LoadHint
  38.     {
  39.         Default = 0,
  40.         // No preference specified
  41.         Always = 1,
  42.         // Dependency is always loaded
  43.         Sometimes = 2
  44.         // Dependency is sometimes loaded
  45.         //Never = 0x0003, // Dependency is never loaded
  46.     }
  47.    
  48. /*
  49.     NGenAttribute is not supported in Whidbey   
  50.     [Serializable, AttributeUsage(AttributeTargets.Assembly)] 
  51.     public sealed class NGenAttribute : Attribute
  52.     {
  53.         private NGenHint hint;
  54.    
  55.         public NGenAttribute (
  56.             NGenHint hintArgument
  57.             )
  58.         {
  59.             hint = hintArgument;
  60.         }
  61.        
  62.         public NGenHint NGenHint
  63.         {
  64.             get
  65.             {
  66.                 return hint;
  67.             }
  68.         }     
  69.     }
  70.     */   
  71.    
  72.     [Serializable(), AttributeUsage(AttributeTargets.Assembly)]
  73.     public sealed class DefaultDependencyAttribute : Attribute
  74.     {
  75.         private LoadHint loadHint;
  76.        
  77.         public DefaultDependencyAttribute(LoadHint loadHintArgument)
  78.         {
  79.             loadHint = loadHintArgument;
  80.         }
  81.        
  82.         public LoadHint LoadHint {
  83.             get { return loadHint; }
  84.         }
  85.     }
  86.    
  87.    
  88.     [Serializable(), AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
  89.     public sealed class DependencyAttribute : Attribute
  90.     {
  91.         private string dependentAssembly;
  92.         private LoadHint loadHint;
  93.        
  94.         public DependencyAttribute(string dependentAssemblyArgument, LoadHint loadHintArgument)
  95.         {
  96.             dependentAssembly = dependentAssemblyArgument;
  97.             loadHint = loadHintArgument;
  98.         }
  99.        
  100.         public string DependentAssembly {
  101.             get { return dependentAssembly; }
  102.         }
  103.        
  104.         public LoadHint LoadHint {
  105.             get { return loadHint; }
  106.         }
  107.     }
  108. }

Developer Fusion