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
- DataViewSetting.cs
- DataGridViewRowHeaderCell.cs
- ViewGenResults.cs
- TextModifierScope.cs
- CompositeCollection.cs
- SafeNativeMethods.cs
- X509Extension.cs
- WebPartMinimizeVerb.cs
- WebPartZone.cs
- RadioButton.cs
- DataServiceResponse.cs
- KeySpline.cs
- DateTime.cs
- MailWriter.cs
- WorkflowServiceBehavior.cs
- TreeViewImageKeyConverter.cs
- HttpModuleActionCollection.cs
- ServiceContractDetailViewControl.cs
- Configuration.cs
- MetadataException.cs
- SamlAuthorizationDecisionClaimResource.cs
- SignatureHelper.cs
- AxParameterData.cs
- DataListItemEventArgs.cs
- DocumentSchemaValidator.cs
- MemberDescriptor.cs
- ConfigXmlText.cs
- ParseNumbers.cs
- IPAddressCollection.cs
- EntityParameter.cs
- ErrorReporting.cs
- ObfuscateAssemblyAttribute.cs
- safemediahandle.cs
- SmiEventStream.cs
- TransactionScope.cs
- StrokeFIndices.cs
- SelectionWordBreaker.cs
- _BaseOverlappedAsyncResult.cs
- PartialList.cs
- _NestedSingleAsyncResult.cs
- DocobjHost.cs
- FrameworkEventSource.cs
- Rect3D.cs
- MenuBase.cs
- SqlTypeSystemProvider.cs
- IncrementalReadDecoders.cs
- OutputCacheProviderCollection.cs
- MessageSecurityProtocol.cs
- LayoutEditorPart.cs
- SmtpException.cs
- TypeElementCollection.cs
- DocumentViewerAutomationPeer.cs
- WorkflowMessageEventArgs.cs
- MenuItemBinding.cs
- RoleManagerSection.cs
- DependencyProperty.cs
- ActiveXHost.cs
- ListBindingConverter.cs
- Journal.cs
- DataRecord.cs
- ObservableDictionary.cs
- ResourcesBuildProvider.cs
- TdsParserSafeHandles.cs
- RenderData.cs
- OletxDependentTransaction.cs
- XMLDiffLoader.cs
- StringAnimationBase.cs
- XmlQueryCardinality.cs
- TraceRecord.cs
- ResourceProviderFactory.cs
- RankException.cs
- SmtpCommands.cs
- RootNamespaceAttribute.cs
- FtpWebResponse.cs
- HttpUnhandledOperationInvoker.cs
- DrawingState.cs
- DATA_BLOB.cs
- LogicalCallContext.cs
- Error.cs
- FixedFlowMap.cs
- UnaryExpression.cs
- CodeDomLoader.cs
- Panel.cs
- NameValueConfigurationCollection.cs
- UDPClient.cs
- BufferedResponseStream.cs
- dataSvcMapFileLoader.cs
- AdapterDictionary.cs
- PageCatalogPartDesigner.cs
- ArcSegment.cs
- DefaultValueConverter.cs
- SiteOfOriginContainer.cs
- WinEventTracker.cs
- Mapping.cs
- MimeParameter.cs
- RIPEMD160.cs
- AdditionalEntityFunctions.cs
- ListViewInsertEventArgs.cs
- CategoryNameCollection.cs
- AutoScrollExpandMessageFilter.cs