Skip to Main Content
C# in a Nutshell, Second Edition
book

C# in a Nutshell, Second Edition

by Peter Drayton, Ben Albahari, Ted Neward
August 2003
Intermediate to advanced content levelIntermediate to advanced
928 pages
32h 1m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell, Second Edition

Name

FieldAttributes

Synopsis

This is an enumeration of the attributes that can be specified on a field. Assembly means that the field is internal (that is, private to the assembly); Family indicates that the field is protected. Private, Public, and Static are self-explanatory. If the field has a default value, HasDefault is marked; if a field is constant, Literal is marked. InitOnly indicates that the field can only be set on object initialization. To exclude a field from being serialized, NotSerialized should be asserted. HasFieldMarshal specifies that the field has special marshaling information.

public enum FieldAttributes {
   PrivateScope = 0x00000000,
   Private = 0x00000001,
   FamANDAssem = 0x00000002,
   Assembly = 0x00000003,
   Family = 0x00000004,
   FamORAssem = 0x00000005,
   Public = 0x00000006,
   FieldAccessMask = 0x00000007,
   Static = 0x00000010,
   InitOnly = 0x00000020,
   Literal = 0x00000040,
   NotSerialized = 0x00000080,
   HasFieldRVA = 0x00000100,
   SpecialName = 0x00000200,
   RTSpecialName = 0x00000400,
   HasFieldMarshal = 0x00001000,
   PinvokeImpl = 0x00002000,
   HasDefault = 0x00008000,
   ReservedMask = 0x00009500
}

Hierarchy

System.Object System.ValueType System.Enum(System.IComparable, System.IFormattable, System.IConvertible) FieldAttributes

Returned By

FieldInfo.Attributes

Passed To

System.Reflection.Emit.ModuleBuilder.{DefineInitializedData( ), DefineUninitializedData( )}, System.Reflection.Emit.TypeBuilder.{DefineField( ), DefineInitializedData( ), DefineUninitializedData( )}

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# in a Nutshell

C# in a Nutshell

Ben Albahari, Ted Neward, Peter Drayton
C# 7.0 in a Nutshell

C# 7.0 in a Nutshell

Joseph Albahari, Ben Albahari
C# Cookbook, 2nd Edition

C# Cookbook, 2nd Edition

Jay Hilyard, Stephen Teilhet
C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard

Publisher Resources

ISBN: 0596005261Catalog PageErrata