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
- ContextMenu.cs
- CharEntityEncoderFallback.cs
- NegationPusher.cs
- QueryOperator.cs
- Transform3DGroup.cs
- ProjectionNode.cs
- TogglePattern.cs
- CaseInsensitiveHashCodeProvider.cs
- ForEachAction.cs
- WpfKnownType.cs
- ListenerSingletonConnectionReader.cs
- ContentValidator.cs
- InputLanguageCollection.cs
- SHA1Managed.cs
- XPathAncestorIterator.cs
- LogStream.cs
- DataGridDetailsPresenter.cs
- SmtpReplyReaderFactory.cs
- TypeConvertions.cs
- MetadataLocation.cs
- ConfigurationManagerHelperFactory.cs
- Viewport2DVisual3D.cs
- SimpleHandlerBuildProvider.cs
- Soap11ServerProtocol.cs
- DataGridRowHeader.cs
- HMACSHA512.cs
- ToolStripDesignerUtils.cs
- SamlAuthorizationDecisionClaimResource.cs
- KeyTime.cs
- ParagraphResult.cs
- ByteViewer.cs
- PeerMaintainer.cs
- DecoderFallback.cs
- MemoryFailPoint.cs
- Thickness.cs
- EmptyStringExpandableObjectConverter.cs
- DataGridViewComboBoxColumn.cs
- CharacterMetricsDictionary.cs
- CalendarDataBindingHandler.cs
- StateDesigner.TransitionInfo.cs
- MemberInfoSerializationHolder.cs
- QueryOperator.cs
- ObjectStateEntryDbDataRecord.cs
- Mouse.cs
- PhysicalFontFamily.cs
- FilterQueryOptionExpression.cs
- Pts.cs
- ContentType.cs
- LayoutEvent.cs
- SecurityKeyIdentifier.cs
- ItemCollection.cs
- ReadOnlyDataSourceView.cs
- TextBreakpoint.cs
- FollowerQueueCreator.cs
- TripleDES.cs
- FactoryGenerator.cs
- CodeMemberField.cs
- ListControl.cs
- ListViewEditEventArgs.cs
- HttpInputStream.cs
- GradientSpreadMethodValidation.cs
- SharedDp.cs
- CacheForPrimitiveTypes.cs
- IdentityReference.cs
- LoginNameDesigner.cs
- TypedServiceChannelBuilder.cs
- VirtualPath.cs
- BamlTreeNode.cs
- _Rfc2616CacheValidators.cs
- DetailsViewModeEventArgs.cs
- LookupNode.cs
- SingleKeyFrameCollection.cs
- RtfNavigator.cs
- TraceData.cs
- FloatMinMaxAggregationOperator.cs
- AspNetSynchronizationContext.cs
- StrongNamePublicKeyBlob.cs
- SmiMetaDataProperty.cs
- DictionarySectionHandler.cs
- DataGridViewRowStateChangedEventArgs.cs
- InkCanvasSelection.cs
- ToolStripItem.cs
- UpdateExpressionVisitor.cs
- ToolStripPanel.cs
- InstanceDataCollection.cs
- LogicalExpr.cs
- mediaeventargs.cs
- RequestValidator.cs
- UnsafeNativeMethods.cs
- ReservationNotFoundException.cs
- TimeSpanValidatorAttribute.cs
- HierarchicalDataSourceControl.cs
- GPPOINTF.cs
- ClosableStream.cs
- indexingfiltermarshaler.cs
- SecurityHelper.cs
- ProcessHostConfigUtils.cs
- CultureInfoConverter.cs
- NotSupportedException.cs
- EntitySetBaseCollection.cs