Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Reflection / Emit / FieldToken.cs / 1 / FieldToken.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: FieldToken
**
**
** Purpose: Represents a Field to the ILGenerator Class
**
**
===========================================================*/
namespace System.Reflection.Emit {
using System;
using System.Reflection;
using System.Security.Permissions;
// The FieldToken class is an opaque representation of the Token returned
// by the Metadata to represent the field. FieldTokens are generated by
// Module.GetFieldToken(). There are no meaningful accessors on this class,
// but it can be passed to ILGenerator which understands it's internals.
[Serializable()]
[System.Runtime.InteropServices.ComVisible(true)]
public struct FieldToken
{
public static readonly FieldToken Empty = new FieldToken();
internal int m_fieldTok;
internal Object m_class;
// Creates an empty FieldToken. A publicly visible constructor so that
// it can be created on the stack.
//public FieldToken() {
// m_fieldTok=0;
// m_attributes=0;
// m_class=null;
//}
// The actual constructor. Sets the field, attributes and class
// variables
internal FieldToken (int field, Type fieldClass) {
m_fieldTok=field;
m_class = fieldClass;
}
public int Token {
get { return m_fieldTok; }
}
// Generates the hash code for this field.
public override int GetHashCode()
{
return (m_fieldTok);
}
// Returns true if obj is an instance of FieldToken and is
// equal to this instance.
public override bool Equals(Object obj)
{
if (obj is FieldToken)
return Equals((FieldToken)obj);
else
return false;
}
public bool Equals(FieldToken obj)
{
return obj.m_fieldTok == m_fieldTok && obj.m_class == m_class;
}
public static bool operator ==(FieldToken a, FieldToken b)
{
return a.Equals(b);
}
public static bool operator !=(FieldToken a, FieldToken b)
{
return !(a == b);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebServiceHostFactory.cs
- WebPartExportVerb.cs
- BindingContext.cs
- XmlNodeChangedEventArgs.cs
- WindowsAuthenticationModule.cs
- SystemWebSectionGroup.cs
- DispatcherFrame.cs
- TraceUtils.cs
- EmptyEnumerator.cs
- TreeNodeConverter.cs
- Visual3D.cs
- SmtpDigestAuthenticationModule.cs
- DataMisalignedException.cs
- assemblycache.cs
- DateTimeConverter.cs
- PrivilegeNotHeldException.cs
- SendMessageRecord.cs
- ContentElementAutomationPeer.cs
- MissingFieldException.cs
- DataControlFieldCell.cs
- TableRowGroup.cs
- SourceFilter.cs
- RequestCache.cs
- BodyGlyph.cs
- IntegerValidator.cs
- WindowsGraphics2.cs
- StylusDevice.cs
- UrlAuthFailedErrorFormatter.cs
- UnsafeNativeMethodsCLR.cs
- ToolStripRenderEventArgs.cs
- ApplicationServicesHostFactory.cs
- DirectoryInfo.cs
- StreamSecurityUpgradeInitiatorBase.cs
- SaveWorkflowCommand.cs
- ServiceChannelFactory.cs
- ObjectDataSourceEventArgs.cs
- ExecutedRoutedEventArgs.cs
- PrimitiveOperationFormatter.cs
- HttpCookieCollection.cs
- Literal.cs
- XmlObjectSerializerReadContextComplexJson.cs
- MexHttpBindingElement.cs
- TemplateBindingExpression.cs
- PublisherMembershipCondition.cs
- OrderedHashRepartitionStream.cs
- CompositeControl.cs
- VectorAnimationBase.cs
- SafeNativeMethodsCLR.cs
- _FtpControlStream.cs
- AndMessageFilterTable.cs
- OptimalTextSource.cs
- SoapAttributeOverrides.cs
- LineSegment.cs
- GlyphTypeface.cs
- SubMenuStyle.cs
- COM2ExtendedUITypeEditor.cs
- StructuredCompositeActivityDesigner.cs
- HostedNamedPipeTransportManager.cs
- OptimizerPatterns.cs
- WorkerRequest.cs
- Point3DCollection.cs
- PixelFormats.cs
- UInt16.cs
- SiteMapNodeItemEventArgs.cs
- ToolBarButtonDesigner.cs
- DatagridviewDisplayedBandsData.cs
- OleDbParameterCollection.cs
- FixedTextContainer.cs
- AsyncOperationManager.cs
- AsynchronousChannelMergeEnumerator.cs
- ImageFormatConverter.cs
- DataGridLength.cs
- BeginEvent.cs
- LocalFileSettingsProvider.cs
- HttpListener.cs
- BoundsDrawingContextWalker.cs
- EventWaitHandleSecurity.cs
- ToolStripDropDownButton.cs
- RepeatInfo.cs
- WpfPayload.cs
- Pair.cs
- DispatcherSynchronizationContext.cs
- ImpersonationContext.cs
- UnknownBitmapDecoder.cs
- DataStreamFromComStream.cs
- PathGradientBrush.cs
- basenumberconverter.cs
- Vector3D.cs
- XomlCompilerResults.cs
- SqlParameterCollection.cs
- Utils.cs
- ImportCatalogPart.cs
- DataGridPagingPage.cs
- coordinatorfactory.cs
- _KerberosClient.cs
- XmlMemberMapping.cs
- PassportIdentity.cs
- CryptoHandle.cs
- ApplicationServicesHostFactory.cs
- OdbcFactory.cs