Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / clr / src / BCL / System / Runtime / Serialization / SerializationFieldInfo.cs / 1 / SerializationFieldInfo.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SerializationFieldInfo ** ** ** Purpose: Provides a methods of representing imaginary fields ** which are unique to serialization. In this case, what we're ** representing is the private members of parent classes. We ** aggregate the RuntimeFieldInfo associated with this member ** and return a managled form of the name. The name that we ** return is .parentname.fieldname ** ** ============================================================*/ using System; using System.Reflection; using System.Globalization; namespace System.Runtime.Serialization { internal sealed class SerializationFieldInfo : FieldInfo { internal static readonly char FakeNameSeparatorChar = '+'; internal static readonly String FakeNameSeparatorString = "+"; private RuntimeFieldInfo m_field; private String m_serializationName; public override Module Module { get { return m_field.Module; } } public override int MetadataToken { get { return m_field.MetadataToken; } } internal SerializationFieldInfo(RuntimeFieldInfo field, String namePrefix) { BCLDebug.Assert(field!=null, "[SerializationFieldInfo.ctor]field!=null"); BCLDebug.Assert(namePrefix!=null, "[SerializationFieldInfo.ctor]namePrefix!=null"); m_field = field; m_serializationName = String.Concat(namePrefix, FakeNameSeparatorString, m_field.Name); } // // MemberInfo methods // public override String Name { get { return m_serializationName; } } public override Type DeclaringType { get { return m_field.DeclaringType; } } public override Type ReflectedType { get { return m_field.ReflectedType; } } public override Object[] GetCustomAttributes(bool inherit) { return m_field.GetCustomAttributes(inherit); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { return m_field.GetCustomAttributes(attributeType, inherit); } public override bool IsDefined(Type attributeType, bool inherit) { return m_field.IsDefined(attributeType, inherit); } // // FieldInfo methods // public override Type FieldType { get { return m_field.FieldType; } } public override Object GetValue(Object obj) { return m_field.GetValue(obj); } internal Object InternalGetValue(Object obj, bool requiresAccessCheck) { RtFieldInfo field = m_field as RtFieldInfo; if (field != null) return field.InternalGetValue(obj, requiresAccessCheck); else return m_field.GetValue(obj); } public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) { m_field.SetValue(obj, value, invokeAttr, binder, culture); } internal void InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture, bool requiresAccessCheck, bool isBinderDefault) { //m_field.InternalSetValue(obj, value, invokeAttr, binder, culture, requiresAccessCheck, isBinderDefault); RtFieldInfo field = m_field as RtFieldInfo; if (field != null) field.InternalSetValue(obj, value, invokeAttr, binder, culture, false); else m_field.SetValue(obj, value, invokeAttr, binder, culture); } internal RuntimeFieldInfo FieldInfo { get { return m_field; } } public override RuntimeFieldHandle FieldHandle { get { return m_field.FieldHandle; } } public override FieldAttributes Attributes { get { return m_field.Attributes; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SerializationFieldInfo ** ** ** Purpose: Provides a methods of representing imaginary fields ** which are unique to serialization. In this case, what we're ** representing is the private members of parent classes. We ** aggregate the RuntimeFieldInfo associated with this member ** and return a managled form of the name. The name that we ** return is .parentname.fieldname ** ** ============================================================*/ using System; using System.Reflection; using System.Globalization; namespace System.Runtime.Serialization { internal sealed class SerializationFieldInfo : FieldInfo { internal static readonly char FakeNameSeparatorChar = '+'; internal static readonly String FakeNameSeparatorString = "+"; private RuntimeFieldInfo m_field; private String m_serializationName; public override Module Module { get { return m_field.Module; } } public override int MetadataToken { get { return m_field.MetadataToken; } } internal SerializationFieldInfo(RuntimeFieldInfo field, String namePrefix) { BCLDebug.Assert(field!=null, "[SerializationFieldInfo.ctor]field!=null"); BCLDebug.Assert(namePrefix!=null, "[SerializationFieldInfo.ctor]namePrefix!=null"); m_field = field; m_serializationName = String.Concat(namePrefix, FakeNameSeparatorString, m_field.Name); } // // MemberInfo methods // public override String Name { get { return m_serializationName; } } public override Type DeclaringType { get { return m_field.DeclaringType; } } public override Type ReflectedType { get { return m_field.ReflectedType; } } public override Object[] GetCustomAttributes(bool inherit) { return m_field.GetCustomAttributes(inherit); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { return m_field.GetCustomAttributes(attributeType, inherit); } public override bool IsDefined(Type attributeType, bool inherit) { return m_field.IsDefined(attributeType, inherit); } // // FieldInfo methods // public override Type FieldType { get { return m_field.FieldType; } } public override Object GetValue(Object obj) { return m_field.GetValue(obj); } internal Object InternalGetValue(Object obj, bool requiresAccessCheck) { RtFieldInfo field = m_field as RtFieldInfo; if (field != null) return field.InternalGetValue(obj, requiresAccessCheck); else return m_field.GetValue(obj); } public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) { m_field.SetValue(obj, value, invokeAttr, binder, culture); } internal void InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture, bool requiresAccessCheck, bool isBinderDefault) { //m_field.InternalSetValue(obj, value, invokeAttr, binder, culture, requiresAccessCheck, isBinderDefault); RtFieldInfo field = m_field as RtFieldInfo; if (field != null) field.InternalSetValue(obj, value, invokeAttr, binder, culture, false); else m_field.SetValue(obj, value, invokeAttr, binder, culture); } internal RuntimeFieldInfo FieldInfo { get { return m_field; } } public override RuntimeFieldHandle FieldHandle { get { return m_field.FieldHandle; } } public override FieldAttributes Attributes { get { return m_field.Attributes; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PaginationProgressEventArgs.cs
- TraceData.cs
- InvokeMethodActivity.cs
- AnnotationHighlightLayer.cs
- UserUseLicenseDictionaryLoader.cs
- DynamicPropertyHolder.cs
- InternalSafeNativeMethods.cs
- InProcStateClientManager.cs
- ResourcesBuildProvider.cs
- ISFClipboardData.cs
- GlobalizationSection.cs
- ChildTable.cs
- _ScatterGatherBuffers.cs
- SchemaSetCompiler.cs
- IsolatedStorageException.cs
- CompositeDataBoundControl.cs
- InlineObject.cs
- DataObject.cs
- DSACryptoServiceProvider.cs
- XmlSchemaAll.cs
- QuaternionAnimation.cs
- XhtmlTextWriter.cs
- DataGridCaption.cs
- CommandValueSerializer.cs
- BitmapEffectRenderDataResource.cs
- PropertyState.cs
- DefaultSection.cs
- ReadOnlyObservableCollection.cs
- FlowLayout.cs
- RelationshipWrapper.cs
- BaseDataList.cs
- XmlIlGenerator.cs
- XmlSchemaSequence.cs
- CodeSnippetExpression.cs
- ProtocolViolationException.cs
- ParamArrayAttribute.cs
- AccessDataSourceView.cs
- RawMouseInputReport.cs
- SspiNegotiationTokenProvider.cs
- EventPropertyMap.cs
- Behavior.cs
- CodeVariableReferenceExpression.cs
- MergePropertyDescriptor.cs
- SamlConditions.cs
- MeasurementDCInfo.cs
- ManagementOptions.cs
- TabItemWrapperAutomationPeer.cs
- OracleSqlParser.cs
- WindowsIdentity.cs
- VariableModifiersHelper.cs
- ToolStripProgressBar.cs
- ProxyHwnd.cs
- ResourceDisplayNameAttribute.cs
- ProfileService.cs
- XmlJsonWriter.cs
- MouseActionConverter.cs
- LineBreakRecord.cs
- DecoderReplacementFallback.cs
- XmlSchemaValidationException.cs
- StringFunctions.cs
- Brush.cs
- translator.cs
- ListenerAdapterBase.cs
- FormsAuthenticationConfiguration.cs
- BindingCompleteEventArgs.cs
- BamlResourceDeserializer.cs
- PropertyTabAttribute.cs
- RegularExpressionValidator.cs
- UserValidatedEventArgs.cs
- DoubleLink.cs
- FtpWebRequest.cs
- DoubleSumAggregationOperator.cs
- ImmutableObjectAttribute.cs
- ManagedWndProcTracker.cs
- IriParsingElement.cs
- RadioButton.cs
- GenericWebPart.cs
- CngKey.cs
- DbDataAdapter.cs
- SerializationStore.cs
- TextChangedEventArgs.cs
- SkinBuilder.cs
- EmptyElement.cs
- _NegotiateClient.cs
- GraphicsContainer.cs
- AppSecurityManager.cs
- FlatButtonAppearance.cs
- DescendentsWalkerBase.cs
- CodeIndexerExpression.cs
- UInt16Converter.cs
- VariantWrapper.cs
- SoundPlayer.cs
- PropertyFilterAttribute.cs
- RawStylusActions.cs
- _ShellExpression.cs
- OutputCacheSection.cs
- SamlAssertionKeyIdentifierClause.cs
- UnsafeNativeMethods.cs
- _ConnectOverlappedAsyncResult.cs
- StorageEndPropertyMapping.cs