Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CryptoApi.cs
- MaskedTextBoxTextEditor.cs
- WebPartDescriptionCollection.cs
- DelegatedStream.cs
- LocalizableAttribute.cs
- PartBasedPackageProperties.cs
- ThicknessConverter.cs
- OleServicesContext.cs
- ContainerSelectorGlyph.cs
- StylusTip.cs
- FusionWrap.cs
- CollectionViewGroup.cs
- DtcInterfaces.cs
- EnterpriseServicesHelper.cs
- IntMinMaxAggregationOperator.cs
- UrlPath.cs
- System.Data_BID.cs
- StorageConditionPropertyMapping.cs
- RegexTree.cs
- UnicodeEncoding.cs
- TokenCreationParameter.cs
- FormParameter.cs
- KeyedCollection.cs
- BrowserCapabilitiesFactoryBase.cs
- FileIOPermission.cs
- EntityDesignerBuildProvider.cs
- CounterSampleCalculator.cs
- KeyTime.cs
- DataStreams.cs
- FragmentQueryProcessor.cs
- CapabilitiesPattern.cs
- ConversionContext.cs
- Application.cs
- RelationshipFixer.cs
- DocobjHost.cs
- ContentPosition.cs
- SmtpFailedRecipientException.cs
- ProcessModuleCollection.cs
- SqlBuffer.cs
- StylusCollection.cs
- AddInAttribute.cs
- GrammarBuilderPhrase.cs
- CompoundFileStreamReference.cs
- TabControlEvent.cs
- GreenMethods.cs
- EnumType.cs
- PolyQuadraticBezierSegment.cs
- _NativeSSPI.cs
- CodeExpressionCollection.cs
- CodeObject.cs
- ContentElement.cs
- HtmlFormParameterWriter.cs
- TabControlDesigner.cs
- ProjectionPlan.cs
- BaseTreeIterator.cs
- PolyBezierSegment.cs
- FigureParagraph.cs
- SchemaRegistration.cs
- Int32CollectionConverter.cs
- DatagridviewDisplayedBandsData.cs
- StyleHelper.cs
- DataGridBoolColumn.cs
- Error.cs
- BuildManager.cs
- MetadataItem.cs
- RegexRunner.cs
- XmlSignatureManifest.cs
- ExtensionCollection.cs
- ChtmlTextWriter.cs
- XmlIterators.cs
- X500Name.cs
- SR.cs
- MenuCommands.cs
- ObfuscationAttribute.cs
- CatalogZone.cs
- EntitySet.cs
- MailSettingsSection.cs
- CompiledQuery.cs
- CodeAccessPermission.cs
- Frame.cs
- tooltip.cs
- SyndicationElementExtension.cs
- OracleDataReader.cs
- JavaScriptObjectDeserializer.cs
- XmlNamedNodeMap.cs
- SecureConversationServiceCredential.cs
- DocumentViewerConstants.cs
- CultureInfo.cs
- SEHException.cs
- IERequestCache.cs
- XmlSignatureProperties.cs
- QilSortKey.cs
- CurrencyWrapper.cs
- DataBindingsDialog.cs
- TreeViewHitTestInfo.cs
- DispatcherOperation.cs
- ConfigUtil.cs
- TriggerBase.cs
- TypeToArgumentTypeConverter.cs
- OutOfProcStateClientManager.cs