1 // ==++== 2 // 3 // Copyright (c) Microsoft Corporation. All rights reserved. 4 // 5 // ==--== 6 //------------------------------------------------------------------------------ 7 //------------------------------------------------------------------------------ 8 9 namespace System.Runtime.CompilerServices 10 { 11 using System; 12 13 14 [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)] 15 public sealed class InternalsVisibleToAttribute : Attribute 16 { 17 private string _assemblyName; 18 private bool _allInternalsVisible = true; 19 InternalsVisibleToAttribute(string assemblyName)20 public InternalsVisibleToAttribute(string assemblyName) 21 { 22 this._assemblyName = assemblyName; 23 } 24 25 public string AssemblyName 26 { 27 get 28 { 29 return _assemblyName; 30 } 31 } 32 33 public bool AllInternalsVisible 34 { 35 get { return _allInternalsVisible; } 36 set { _allInternalsVisible = value; } 37 } 38 } 39 40 /// <summary> 41 /// If AllInternalsVisible is not true for a friend assembly, the FriendAccessAllowed attribute 42 /// indicates which internals are shared with that friend assembly. 43 /// </summary> 44 [AttributeUsage(AttributeTargets.Class | 45 AttributeTargets.Constructor | 46 AttributeTargets.Enum | 47 AttributeTargets.Event | 48 AttributeTargets.Field | 49 AttributeTargets.Interface | 50 AttributeTargets.Method | 51 AttributeTargets.Property | 52 AttributeTargets.Struct, 53 AllowMultiple = false, 54 Inherited = false)] 55 [FriendAccessAllowed] 56 internal sealed class FriendAccessAllowedAttribute : Attribute { 57 } 58 } 59 60