FixedBufferAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Runtime / CompilerServices / FixedBufferAttribute.cs / 1 / FixedBufferAttribute.cs

                            // ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 
/*============================================================
** 
** Class:  FixedBufferAttribute 
**
** Purpose: Used by a compiler for generating value types 
**   in-place within other value types containing a certain
**   number of elements of the given (primitive) type.  Somewhat
**   similar to P/Invoke's ByValTStr attribute.
**   Used by C# with this syntax: "fixed int buffer[10];" 
**
===========================================================*/ 
using System; 

namespace System.Runtime.CompilerServices 
{
 	[AttributeUsage(AttributeTargets.Field, Inherited=false)]
	public sealed class FixedBufferAttribute : Attribute
	{ 
		private Type elementType;
 		private int length; 
 
		public FixedBufferAttribute(Type elementType, int length)
 		{ 
 			this.elementType = elementType;
			this.length = length;
 		}
 
		public Type ElementType {
			get { 
				return elementType; 
 			}
		} 

 		public int Length {
 			get {
				return length; 
 			}
		} 
	} 
}
                        

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