TypeForwardedToAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / CompilerServices / TypeForwardedToAttribute.cs / 1305376 / TypeForwardedToAttribute.cs

                            // ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 

using System; 
using System.Reflection; 

namespace System.Runtime.CompilerServices 
{
    using System;
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
    public sealed class TypeForwardedToAttribute : Attribute 
    {
        private Type _destination; 
 
        public TypeForwardedToAttribute(Type destination)
        { 
            _destination = destination;
        }

        public Type Destination 
        {
            get { 
                return _destination; 
            }
        } 

        [System.Security.SecurityCritical]
        internal static TypeForwardedToAttribute[] GetCustomAttribute(RuntimeAssembly assembly)
        { 
            Type[] types = null;
            RuntimeAssembly.GetForwardedTypes(assembly.GetNativeHandle(), JitHelpers.GetObjectHandleOnStack(ref types)); 
 
            TypeForwardedToAttribute[] attributes = new TypeForwardedToAttribute[types.Length];
            for (int i = 0; i < types.Length; ++i) 
                attributes[i] = new TypeForwardedToAttribute(types[i]);

            return attributes;
        } 

    } 
} 

 



// File provided for Reference Use Only by Microsoft Corporation (c) 2007.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK