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
- XhtmlBasicValidatorAdapter.cs
- MimeBasePart.cs
- InputLangChangeEvent.cs
- CompoundFileReference.cs
- KeyConstraint.cs
- Hashtable.cs
- BoundsDrawingContextWalker.cs
- SelectedGridItemChangedEvent.cs
- Cell.cs
- ImageButton.cs
- LogEntryDeserializer.cs
- ConnectorDragDropGlyph.cs
- ImportCatalogPart.cs
- Int16Storage.cs
- CollectionConverter.cs
- MemberListBinding.cs
- TemplateBindingExpression.cs
- GraphicsPathIterator.cs
- FolderBrowserDialog.cs
- FixedDocumentSequencePaginator.cs
- InfiniteTimeSpanConverter.cs
- OdbcParameter.cs
- UrlAuthFailedErrorFormatter.cs
- ObjectQuery.cs
- VirtualPathProvider.cs
- HttpCapabilitiesBase.cs
- TableItemProviderWrapper.cs
- DataGridAddNewRow.cs
- AsymmetricSignatureDeformatter.cs
- VisualProxy.cs
- XmlRawWriterWrapper.cs
- EdmRelationshipRoleAttribute.cs
- odbcmetadatacolumnnames.cs
- BamlReader.cs
- AddInContractAttribute.cs
- DataStorage.cs
- ExpressionBuilderCollection.cs
- CodeTypeParameter.cs
- Selection.cs
- XmlSchemaComplexContentExtension.cs
- TextSelectionProcessor.cs
- SQLString.cs
- DetailsViewModeEventArgs.cs
- UnsafeNetInfoNativeMethods.cs
- SqlBulkCopyColumnMapping.cs
- EntityDataSourceWizardForm.cs
- XmlIgnoreAttribute.cs
- CodeGeneratorOptions.cs
- CatalogZone.cs
- DrawingVisualDrawingContext.cs
- NextPreviousPagerField.cs
- NumericUpDownAccelerationCollection.cs
- DictionaryEntry.cs
- CodeCatchClauseCollection.cs
- DataTableMapping.cs
- SharedPersonalizationStateInfo.cs
- InputBuffer.cs
- HelloMessageCD1.cs
- AppDomainFactory.cs
- IpcClientManager.cs
- ValidationSummary.cs
- InvokeBase.cs
- WebPart.cs
- ModelPerspective.cs
- DirectoryLocalQuery.cs
- Margins.cs
- GroupDescription.cs
- SetterBase.cs
- SqlDataSourceFilteringEventArgs.cs
- PropertyEntry.cs
- FileFormatException.cs
- DescendantOverDescendantQuery.cs
- ManagementEventArgs.cs
- PartialTrustVisibleAssemblyCollection.cs
- StreamingContext.cs
- ItemCheckEvent.cs
- Misc.cs
- HtmlForm.cs
- XmlTypeMapping.cs
- ProgressiveCrcCalculatingStream.cs
- WrappedReader.cs
- ComponentCollection.cs
- ImageListStreamer.cs
- FixedPage.cs
- FontFamily.cs
- OptimisticConcurrencyException.cs
- BindableAttribute.cs
- XPathParser.cs
- HelpInfo.cs
- EventDriven.cs
- PropertyGroupDescription.cs
- ColorMap.cs
- VoiceChangeEventArgs.cs
- DataContractFormatAttribute.cs
- FormViewCommandEventArgs.cs
- TempFiles.cs
- SspiSecurityTokenProvider.cs
- ExceptionNotification.cs
- XmlQueryOutput.cs
- PropertyPathConverter.cs