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
- DataGridTable.cs
- RuntimeHandles.cs
- SplitterPanelDesigner.cs
- Thread.cs
- Matrix.cs
- FileRecordSequence.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- ConfigurationStrings.cs
- LineMetrics.cs
- RightsManagementInformation.cs
- PolicyUnit.cs
- SingleObjectCollection.cs
- Query.cs
- BitmapEffectInputConnector.cs
- SiteMapNodeItemEventArgs.cs
- SmiMetaData.cs
- RuntimeCompatibilityAttribute.cs
- CacheForPrimitiveTypes.cs
- SortFieldComparer.cs
- WindowInteractionStateTracker.cs
- RegexBoyerMoore.cs
- BookmarkTable.cs
- TimeStampChecker.cs
- NativeMethodsOther.cs
- UInt16Converter.cs
- OleDbCommand.cs
- DBConnection.cs
- TypeConverterHelper.cs
- XmlNode.cs
- QilVisitor.cs
- GridViewColumnHeader.cs
- WithParamAction.cs
- Matrix3DStack.cs
- HtmlUtf8RawTextWriter.cs
- ResXResourceSet.cs
- Canonicalizers.cs
- NotifyParentPropertyAttribute.cs
- AnnotationResource.cs
- EditorZoneBase.cs
- ListViewInsertEventArgs.cs
- DBSqlParserColumnCollection.cs
- MouseActionConverter.cs
- BinaryObjectInfo.cs
- TemplatedAdorner.cs
- MimeFormatter.cs
- WindowsRichEditRange.cs
- CodeIterationStatement.cs
- BitmapEffectvisualstate.cs
- TextTreeDeleteContentUndoUnit.cs
- XamlFilter.cs
- X509UI.cs
- TrustManagerPromptUI.cs
- WebPartConnectionsCancelVerb.cs
- SortDescriptionCollection.cs
- TextDocumentView.cs
- HttpProcessUtility.cs
- Tablet.cs
- WorkflowMarkupSerializer.cs
- LayoutDump.cs
- Trace.cs
- DataBoundLiteralControl.cs
- Content.cs
- XmlSchemaSimpleTypeList.cs
- AttributeInfo.cs
- FixedSOMTableCell.cs
- DataRelation.cs
- BmpBitmapDecoder.cs
- SHA512Managed.cs
- BindValidationContext.cs
- HtmlInputPassword.cs
- ProfileSettingsCollection.cs
- OrthographicCamera.cs
- CommonGetThemePartSize.cs
- ForeignKeyConstraint.cs
- EntityExpressionVisitor.cs
- Win32.cs
- PeerPresenceInfo.cs
- nulltextcontainer.cs
- ConfigurationLocationCollection.cs
- OneWayElement.cs
- ParseChildrenAsPropertiesAttribute.cs
- RenderData.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- FrameworkRichTextComposition.cs
- CodeMethodReturnStatement.cs
- ExternalFile.cs
- CertificateElement.cs
- _LocalDataStore.cs
- StyleCollectionEditor.cs
- PlainXmlSerializer.cs
- StylusPoint.cs
- SyndicationItem.cs
- RIPEMD160Managed.cs
- ProcessHostFactoryHelper.cs
- FileSystemWatcher.cs
- ProbeMatchesMessage11.cs
- SchemaMerger.cs
- ImageSourceValueSerializer.cs
- XamlHostingSectionGroup.cs