Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConfigurationSectionGroupCollection.cs
- InvalidMessageContractException.cs
- FocusChangedEventArgs.cs
- RefreshEventArgs.cs
- PermissionAttributes.cs
- HttpGetProtocolImporter.cs
- SwitchLevelAttribute.cs
- PagesChangedEventArgs.cs
- DetailsViewRow.cs
- ChannelManager.cs
- Codec.cs
- BuiltInExpr.cs
- ScriptDescriptor.cs
- ConstraintCollection.cs
- RunWorkerCompletedEventArgs.cs
- Transform3DGroup.cs
- RectKeyFrameCollection.cs
- ActivationArguments.cs
- HttpConfigurationContext.cs
- COM2IDispatchConverter.cs
- InvalidCommandTreeException.cs
- DomNameTable.cs
- DBParameter.cs
- StringFormat.cs
- ResourceDisplayNameAttribute.cs
- ActivitySurrogate.cs
- URLAttribute.cs
- XmlIgnoreAttribute.cs
- WeakReferenceKey.cs
- MatcherBuilder.cs
- oledbmetadatacollectionnames.cs
- TPLETWProvider.cs
- Dynamic.cs
- InProcStateClientManager.cs
- AppSettingsReader.cs
- ObjectDataSourceStatusEventArgs.cs
- File.cs
- SettingsSection.cs
- DataSetUtil.cs
- FileReservationCollection.cs
- EntityProxyTypeInfo.cs
- TabPanel.cs
- DrawingCollection.cs
- _BaseOverlappedAsyncResult.cs
- MatchSingleFxEngineOpcode.cs
- SHA256Managed.cs
- SizeChangedInfo.cs
- MappedMetaModel.cs
- DefaultAssemblyResolver.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- TextTreeDeleteContentUndoUnit.cs
- ScriptResourceAttribute.cs
- FixedPageAutomationPeer.cs
- ColorTransformHelper.cs
- CDSsyncETWBCLProvider.cs
- RepeatBehavior.cs
- AutoGeneratedFieldProperties.cs
- CanonicalFontFamilyReference.cs
- XmlSchemaProviderAttribute.cs
- ChannelFactoryBase.cs
- LiteralControl.cs
- UnmanagedMarshal.cs
- InfoCardBinaryReader.cs
- VoiceInfo.cs
- Listbox.cs
- EventLogger.cs
- DataGridViewRow.cs
- Paragraph.cs
- DependencyPropertyConverter.cs
- OpenFileDialog.cs
- DataContractSet.cs
- CommonXSendMessage.cs
- Visitors.cs
- XmlSchemaImport.cs
- HtmlButton.cs
- SiteMapDataSourceDesigner.cs
- TaskFactory.cs
- MULTI_QI.cs
- ColumnResizeAdorner.cs
- SessionIDManager.cs
- NumberAction.cs
- OverloadGroupAttribute.cs
- WebPartConnectionsConfigureVerb.cs
- ExtensionFile.cs
- BuildResult.cs
- EventProviderTraceListener.cs
- RemotingServices.cs
- ControlPaint.cs
- Margins.cs
- ServerProtocol.cs
- ToolboxDataAttribute.cs
- FtpWebResponse.cs
- UrlAuthFailedErrorFormatter.cs
- SqlDataAdapter.cs
- QueueProcessor.cs
- DrawListViewItemEventArgs.cs
- IndexedEnumerable.cs
- XmlNotation.cs
- Int32KeyFrameCollection.cs
- ToolStripItemImageRenderEventArgs.cs