Skip to Main Content
C# in a Nutshell
book

C# in a Nutshell

by Ben Albahari, Ted Neward, Peter Drayton
March 2002
Intermediate to advanced content levelIntermediate to advanced
864 pages
31h 8m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell

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 = 0,
   Private = 1,
   FamANDAssem = 2,
   Assembly = 3,
   Family = 4,
   FamORAssem = 5,
   Public = 6,
   FieldAccessMask = 7,
   Static = 16,
   InitOnly = 32,
   Literal = 64,
   NotSerialized = 128,
   HasFieldRVA = 256,
   SpecialName = 512,
   RTSpecialName = 1024,
   HasFieldMarshal = 4096,
   PinvokeImpl = 8192,
   HasDefault = 32768,
   ReservedMask = 38144
}

Hierarchy

System.ObjectSystem.ValueTypeSystem.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# 8.0 in a Nutshell

C# 8.0 in a Nutshell

Joseph Albahari, Eric Johannsen
C# 10 in a Nutshell

C# 10 in a Nutshell

Joseph Albahari
C# in a Nutshell, Second Edition

C# in a Nutshell, Second Edition

Peter Drayton, Ben Albahari, Ted Neward
Code like a Pro in C#

Code like a Pro in C#

Jort Rodenburg

Publisher Resources

ISBN: 0596001819Catalog PageErrata