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
- BufferedReceiveManager.cs
- LockedBorderGlyph.cs
- DoubleConverter.cs
- LinqDataSourceSelectEventArgs.cs
- HostedBindingBehavior.cs
- XPathArrayIterator.cs
- Vertex.cs
- Ops.cs
- MruCache.cs
- BindableTemplateBuilder.cs
- StructuredCompositeActivityDesigner.cs
- JapaneseLunisolarCalendar.cs
- DataGridToolTip.cs
- Compensation.cs
- GeneralTransformCollection.cs
- VirtualizingPanel.cs
- ContractMapping.cs
- LoginStatusDesigner.cs
- login.cs
- RuntimeResourceSet.cs
- WindowsGrip.cs
- NavigationPropertyEmitter.cs
- AccessText.cs
- RoutedEventArgs.cs
- CryptoApi.cs
- DefaultValidator.cs
- AssemblyAttributes.cs
- ParameterCollection.cs
- sqlmetadatafactory.cs
- MatrixTransform3D.cs
- NameValuePair.cs
- ErrorStyle.cs
- XsdValidatingReader.cs
- GroupStyle.cs
- VirtualizingStackPanel.cs
- SafeCoTaskMem.cs
- MD5CryptoServiceProvider.cs
- AssemblyFilter.cs
- EntityWithKeyStrategy.cs
- OperatingSystem.cs
- DropAnimation.xaml.cs
- SnapLine.cs
- MessageQueuePermission.cs
- ServiceDesigner.xaml.cs
- XmlCDATASection.cs
- TrustLevelCollection.cs
- URLMembershipCondition.cs
- TextEmbeddedObject.cs
- TableLayoutCellPaintEventArgs.cs
- ExceptionHelpers.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- _ListenerAsyncResult.cs
- DiagnosticEventProvider.cs
- SafePointer.cs
- MsmqOutputMessage.cs
- TrackingStringDictionary.cs
- SafeArrayTypeMismatchException.cs
- FixedSOMTableCell.cs
- ResourceDictionary.cs
- SafeNativeMethods.cs
- _NetRes.cs
- SplitterPanel.cs
- Expressions.cs
- UserNameSecurityTokenAuthenticator.cs
- ParserHooks.cs
- Activity.cs
- TdsParserStaticMethods.cs
- Emitter.cs
- EmptyQuery.cs
- DataSourceSelectArguments.cs
- WebBrowser.cs
- Debugger.cs
- Processor.cs
- SecurityException.cs
- KnownBoxes.cs
- CommentEmitter.cs
- CopyAction.cs
- HttpInputStream.cs
- UntypedNullExpression.cs
- XmlSchemaSimpleTypeList.cs
- HttpChannelFactory.cs
- DifferencingCollection.cs
- DBSchemaRow.cs
- CqlLexer.cs
- GeneralTransformGroup.cs
- Msec.cs
- TreeViewCancelEvent.cs
- Transform3D.cs
- BitmapEffectGroup.cs
- Set.cs
- DbgUtil.cs
- LinqDataSourceUpdateEventArgs.cs
- TraceSection.cs
- UserPreferenceChangedEventArgs.cs
- BooleanProjectedSlot.cs
- DbLambda.cs
- XmlSchemaSubstitutionGroup.cs
- ConnectionStringSettingsCollection.cs
- UserNameServiceElement.cs
- GridViewCommandEventArgs.cs