Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Server / System / Data / Services / MimeTypeAttribute.cs / 1305376 / MimeTypeAttribute.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to decorate properties and custom service // operations with a MIME type. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services { using System; using System.Diagnostics; using System.Linq; using System.Reflection; ////// Use this attribute on a DataService service operation method /// or a data object property to indicate than the type returned is /// of a specific MIME type. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public sealed class MimeTypeAttribute : Attribute { ///Name of the attributed method or property. private readonly string memberName; ///MIME type for the attributed method or property. private readonly string mimeType; ////// Initializes a new /// Name of the attributed method or property. /// MIME type for the attributed method or property. public MimeTypeAttribute(string memberName, string mimeType) { this.memberName = memberName; this.mimeType = mimeType; } ///instance with /// the specified MIME type. /// Name of the attributed method or property. public string MemberName { get { return this.memberName; } } ////// MIME type for the attributed method or property. /// public string MimeType { get { return this.mimeType; } } ////// Gets the MIME type declared on the specified /// Member to check. ///. /// /// The MIME type declared on the specified internal static MimeTypeAttribute GetMimeTypeAttribute(MemberInfo member) { Debug.Assert(member != null, "member != null"); return member.ReflectedType.GetCustomAttributes(typeof(MimeTypeAttribute), true) .Cast; null /// if no attribute is declared. /// () .FirstOrDefault(o => o.MemberName == member.Name); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a class to decorate properties and custom service // operations with a MIME type. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services { using System; using System.Diagnostics; using System.Linq; using System.Reflection; ////// Use this attribute on a DataService service operation method /// or a data object property to indicate than the type returned is /// of a specific MIME type. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public sealed class MimeTypeAttribute : Attribute { ///Name of the attributed method or property. private readonly string memberName; ///MIME type for the attributed method or property. private readonly string mimeType; ////// Initializes a new /// Name of the attributed method or property. /// MIME type for the attributed method or property. public MimeTypeAttribute(string memberName, string mimeType) { this.memberName = memberName; this.mimeType = mimeType; } ///instance with /// the specified MIME type. /// Name of the attributed method or property. public string MemberName { get { return this.memberName; } } ////// MIME type for the attributed method or property. /// public string MimeType { get { return this.mimeType; } } ////// Gets the MIME type declared on the specified /// Member to check. ///. /// /// The MIME type declared on the specified internal static MimeTypeAttribute GetMimeTypeAttribute(MemberInfo member) { Debug.Assert(member != null, "member != null"); return member.ReflectedType.GetCustomAttributes(typeof(MimeTypeAttribute), true) .Cast; null /// if no attribute is declared. /// () .FirstOrDefault(o => o.MemberName == member.Name); } } } // 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
- NavigationEventArgs.cs
- TreeWalkHelper.cs
- SpellerStatusTable.cs
- ItemAutomationPeer.cs
- BindingOperations.cs
- EmptyEnumerator.cs
- AccessControlList.cs
- ToolZone.cs
- XPathNavigatorKeyComparer.cs
- ImageList.cs
- BufferedStream.cs
- MemberInfoSerializationHolder.cs
- VisualStates.cs
- ObjectListFieldsPage.cs
- BindStream.cs
- EventNotify.cs
- SerializationInfo.cs
- PropertyDescriptorComparer.cs
- HashCodeCombiner.cs
- FormViewRow.cs
- CryptoConfig.cs
- SrgsItemList.cs
- BitmapEffectGeneralTransform.cs
- FlowNode.cs
- WizardForm.cs
- DetailsViewRow.cs
- ValidationEventArgs.cs
- VScrollBar.cs
- DataObjectSettingDataEventArgs.cs
- MgmtConfigurationRecord.cs
- EntitySetDataBindingList.cs
- PropertyGroupDescription.cs
- FormViewUpdatedEventArgs.cs
- HtmlInputReset.cs
- VirtualizedContainerService.cs
- DefinitionUpdate.cs
- SQLBinary.cs
- ModelUtilities.cs
- Size.cs
- UnSafeCharBuffer.cs
- DesignerAutoFormat.cs
- ReceiveMessageRecord.cs
- Trace.cs
- namescope.cs
- DataGridViewRow.cs
- Color.cs
- ScriptingJsonSerializationSection.cs
- InkCollectionBehavior.cs
- FormsAuthenticationUser.cs
- HtmlTableCell.cs
- BrushMappingModeValidation.cs
- DataGridItemAutomationPeer.cs
- LayeredChannelListener.cs
- SignatureSummaryDialog.cs
- EntityDataSourceDesignerHelper.cs
- TokenBasedSet.cs
- Rect3D.cs
- DPCustomTypeDescriptor.cs
- DataTemplateSelector.cs
- PageEventArgs.cs
- WsdlBuildProvider.cs
- CodeGroup.cs
- MessageQueueEnumerator.cs
- TimelineGroup.cs
- OleDbErrorCollection.cs
- MutexSecurity.cs
- followingquery.cs
- CSharpCodeProvider.cs
- CodeTypeMember.cs
- PropertyOverridesTypeEditor.cs
- CursorEditor.cs
- GradientStop.cs
- SerializerProvider.cs
- ButtonRenderer.cs
- DeferrableContent.cs
- AppAction.cs
- ReaderContextStackData.cs
- SqlMethodTransformer.cs
- GacUtil.cs
- XmlExtensionFunction.cs
- ControlIdConverter.cs
- RadioButtonAutomationPeer.cs
- SQLDecimalStorage.cs
- UnaryOperationBinder.cs
- RevocationPoint.cs
- SchemaType.cs
- FormatConvertedBitmap.cs
- DocumentationServerProtocol.cs
- EventEntry.cs
- UnsafeNativeMethodsPenimc.cs
- RadialGradientBrush.cs
- DataControlField.cs
- MenuAutomationPeer.cs
- MeshGeometry3D.cs
- XXXOnTypeBuilderInstantiation.cs
- EndpointDiscoveryMetadata11.cs
- UndoManager.cs
- StylusPointPropertyId.cs
- ComponentEditorForm.cs
- ServiceModelDictionary.cs