Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Compiler / TypeSystem / FieldInfo.cs / 1305376 / FieldInfo.cs
#pragma warning disable 1634, 1691 namespace System.Workflow.ComponentModel.Compiler { using System; using System.CodeDom; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Globalization; using System.Reflection; #region DesignTimeFieldInfo internal sealed class DesignTimeFieldInfo: FieldInfo { #region Members and Constructors private Attribute[] attributes = null; private FieldAttributes fieldAttributes; private DesignTimeType declaringType; private CodeMemberField codeDomField; internal DesignTimeFieldInfo(DesignTimeType declaringType, CodeMemberField codeDomField) { if (declaringType == null) { throw new ArgumentNullException("Declaring Type"); } if (codeDomField == null) { throw new ArgumentNullException("codeDomEvent"); } this.declaringType = declaringType; this.codeDomField = codeDomField; fieldAttributes = Helper.ConvertToFieldAttributes(codeDomField.Attributes); } #endregion #region FieldInfo overrides public override RuntimeFieldHandle FieldHandle { get { // not interested in Runtime information #pragma warning suppress 56503 throw new NotImplementedException(TypeSystemSR.GetString("Error_RuntimeNotSupported")); } } public override Type FieldType { get { return declaringType.ResolveType(DesignTimeType.GetTypeNameFromCodeTypeReference(this.codeDomField.Type, declaringType)); } } public override Object GetValue(object obj) { // We don't need to get into instance probing throw new NotImplementedException(TypeSystemSR.GetString("Error_RuntimeNotSupported")); } public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) { // We don't need to get into instance probing throw new NotImplementedException(TypeSystemSR.GetString("Error_RuntimeNotSupported")); } public override FieldAttributes Attributes { get { return this.fieldAttributes; } } #endregion #region MemberInfo Overrides public override string Name { get { return Helper.EnsureTypeName(this.codeDomField.Name); } } public override Type DeclaringType { get { return this.declaringType; } } public override Type ReflectedType { get { return this.declaringType; } } public override object[] GetCustomAttributes(bool inherit) { return GetCustomAttributes(typeof(object), inherit); } public override object[] GetCustomAttributes(Type attributeType, bool inherit) { if (attributeType == null) throw new ArgumentNullException("attributeType"); if (this.attributes == null) this.attributes = Helper.LoadCustomAttributes(this.codeDomField.CustomAttributes, this.DeclaringType as DesignTimeType); return Helper.GetCustomAttributes(attributeType, inherit, this.attributes, this); } public override bool IsDefined(Type attributeType, bool inherit) { if (attributeType == null) throw new ArgumentNullException("attributeType"); if (this.attributes == null) this.attributes = Helper.LoadCustomAttributes(this.codeDomField.CustomAttributes, this.DeclaringType as DesignTimeType); if (Helper.IsDefined(attributeType, inherit, attributes, this)) return true; return false; } #endregion } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. #pragma warning disable 1634, 1691 namespace System.Workflow.ComponentModel.Compiler { using System; using System.CodeDom; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Globalization; using System.Reflection; #region DesignTimeFieldInfo internal sealed class DesignTimeFieldInfo: FieldInfo { #region Members and Constructors private Attribute[] attributes = null; private FieldAttributes fieldAttributes; private DesignTimeType declaringType; private CodeMemberField codeDomField; internal DesignTimeFieldInfo(DesignTimeType declaringType, CodeMemberField codeDomField) { if (declaringType == null) { throw new ArgumentNullException("Declaring Type"); } if (codeDomField == null) { throw new ArgumentNullException("codeDomEvent"); } this.declaringType = declaringType; this.codeDomField = codeDomField; fieldAttributes = Helper.ConvertToFieldAttributes(codeDomField.Attributes); } #endregion #region FieldInfo overrides public override RuntimeFieldHandle FieldHandle { get { // not interested in Runtime information #pragma warning suppress 56503 throw new NotImplementedException(TypeSystemSR.GetString("Error_RuntimeNotSupported")); } } public override Type FieldType { get { return declaringType.ResolveType(DesignTimeType.GetTypeNameFromCodeTypeReference(this.codeDomField.Type, declaringType)); } } public override Object GetValue(object obj) { // We don't need to get into instance probing throw new NotImplementedException(TypeSystemSR.GetString("Error_RuntimeNotSupported")); } public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) { // We don't need to get into instance probing throw new NotImplementedException(TypeSystemSR.GetString("Error_RuntimeNotSupported")); } public override FieldAttributes Attributes { get { return this.fieldAttributes; } } #endregion #region MemberInfo Overrides public override string Name { get { return Helper.EnsureTypeName(this.codeDomField.Name); } } public override Type DeclaringType { get { return this.declaringType; } } public override Type ReflectedType { get { return this.declaringType; } } public override object[] GetCustomAttributes(bool inherit) { return GetCustomAttributes(typeof(object), inherit); } public override object[] GetCustomAttributes(Type attributeType, bool inherit) { if (attributeType == null) throw new ArgumentNullException("attributeType"); if (this.attributes == null) this.attributes = Helper.LoadCustomAttributes(this.codeDomField.CustomAttributes, this.DeclaringType as DesignTimeType); return Helper.GetCustomAttributes(attributeType, inherit, this.attributes, this); } public override bool IsDefined(Type attributeType, bool inherit) { if (attributeType == null) throw new ArgumentNullException("attributeType"); if (this.attributes == null) this.attributes = Helper.LoadCustomAttributes(this.codeDomField.CustomAttributes, this.DeclaringType as DesignTimeType); if (Helper.IsDefined(attributeType, inherit, attributes, this)) return true; return false; } #endregion } #endregion } // 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
- JsonReaderDelegator.cs
- InheritanceAttribute.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- WebPartsPersonalization.cs
- Utilities.cs
- ComboBoxRenderer.cs
- ToolStripRenderer.cs
- EastAsianLunisolarCalendar.cs
- DesignTimeTemplateParser.cs
- Base64Encoder.cs
- TdsParameterSetter.cs
- DataServiceCollectionOfT.cs
- Axis.cs
- MsmqIntegrationChannelListener.cs
- Funcletizer.cs
- AutoGeneratedField.cs
- Pen.cs
- RegexWorker.cs
- Manipulation.cs
- ParsedAttributeCollection.cs
- WebZone.cs
- OSFeature.cs
- DbMetaDataCollectionNames.cs
- WinOEToolBoxItem.cs
- FormsAuthenticationConfiguration.cs
- UpdatePanelControlTrigger.cs
- RightsManagementLicense.cs
- Transform3D.cs
- EndpointIdentityConverter.cs
- TimeSpan.cs
- PropertyConverter.cs
- CaseInsensitiveComparer.cs
- EasingKeyFrames.cs
- PeerApplication.cs
- Random.cs
- RoutedEventConverter.cs
- QueryStatement.cs
- DeviceContext.cs
- CodePageEncoding.cs
- FlowLayoutSettings.cs
- ManipulationInertiaStartingEventArgs.cs
- SafeSystemMetrics.cs
- XmlElement.cs
- ResourceSet.cs
- RepeaterItemEventArgs.cs
- KeyBinding.cs
- NumberSubstitution.cs
- WebPartCollection.cs
- TraceSection.cs
- WebPartConnectionsConnectVerb.cs
- QilBinary.cs
- FreezableDefaultValueFactory.cs
- RSAOAEPKeyExchangeFormatter.cs
- ZipFileInfoCollection.cs
- WebPartDisplayModeCancelEventArgs.cs
- NativeMethodsOther.cs
- FormatterConverter.cs
- QueueProcessor.cs
- MaskedTextBox.cs
- ClientCultureInfo.cs
- NavigationEventArgs.cs
- DispatcherExceptionFilterEventArgs.cs
- SymDocumentType.cs
- InstanceKeyView.cs
- DbgCompiler.cs
- PackageStore.cs
- ParallelTimeline.cs
- Solver.cs
- CheckBoxFlatAdapter.cs
- ToolStripItemClickedEventArgs.cs
- DataGridViewRowPostPaintEventArgs.cs
- FormatterServicesNoSerializableCheck.cs
- TransactionManager.cs
- exports.cs
- Stack.cs
- ListControlDesigner.cs
- HtmlSelectionListAdapter.cs
- WSHttpSecurityElement.cs
- UnsafePeerToPeerMethods.cs
- SafeRightsManagementEnvironmentHandle.cs
- OracleDataAdapter.cs
- BoolExpr.cs
- ListViewCancelEventArgs.cs
- AppDomainAttributes.cs
- SynchronousChannel.cs
- SizeAnimationBase.cs
- TabletCollection.cs
- CutCopyPasteHelper.cs
- ScriptResourceAttribute.cs
- StructureChangedEventArgs.cs
- XPathChildIterator.cs
- TemplateControlCodeDomTreeGenerator.cs
- ProjectionCamera.cs
- UnauthorizedWebPart.cs
- XmlUTF8TextReader.cs
- ConfigXmlText.cs
- OracleConnectionStringBuilder.cs
- TypeToArgumentTypeConverter.cs
- bidPrivateBase.cs
- EdmComplexPropertyAttribute.cs